1. Netty 란?
2. Netty 성능
https://www.techempower.com/benchmarks/#section=data-r9&hw=i7&test=plaintext
1. Netty 란?
2. Netty 성능
https://www.techempower.com/benchmarks/#section=data-r9&hw=i7&test=plaintext

Runnable r = () -> { System.out.println("hello"); };
Collections.sort(strings, (String a, String b) -> -(a.compareTo(b)));
http://cr.openjdk.java.net/~briangoetz/lambda/lambda-translation.htmlMessage and Runnable objects associated with a thread's MessageQueue. Each Handler instance is associated with a single thread and that thread's message queue. When you create a new Handler, it is bound to the thread / message queue of the thread that is creating it -- from that point on, it will deliver messages and runnables to that message queue and execute them as they come out of the message queue.| private void setNpbgFixxer( NumberPicker np ){ | |||||||
| try { | |||||||
| Method method = np.getClass().getDeclaredMethod("changeValueByOne", boolean.class); | |||||||
| method.setAccessible(true); | |||||||
| method.invoke(np, true); | |||||||
| } catch (NoSuchMethodException e) { | |||||||
| e.printStackTrace(); | |||||||
| } catch (IllegalArgumentException e) { | |||||||
| e.printStackTrace(); | |||||||
| } catch (IllegalAccessException e) { | |||||||
| e.printStackTrace(); | |||||||
| } catch (InvocationTargetException e) { | |||||||
| e.printStackTrace(); | |||||||
| } | |||||||
| Field f = null; | |||||||
| try { | |||||||
| f =NumberPicker.class.getDeclaredField("mInputText"); | |||||||
| } catch (NoSuchFieldException e) { | |||||||
| e.printStackTrace(); | |||||||
| } | |||||||
| f.setAccessible(true); | |||||||
| EditText inputText = null; | |||||||
| try { | |||||||
| inputText = (EditText)f.get(np); | |||||||
| } catch (IllegalAccessException e) { | |||||||
| e.printStackTrace(); | |||||||
| } | |||||||
| inputText.setFilters(new InputFilter[0]); | |||||||
| } | |||||||
TextView title;
...
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_activity);
title = (TextView)activity.findViewById(R.id.title);
// TODO Use fields...
}
@BindView(R.id.title) TextView title;
...
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_activity);
ButterKnife.bind(this);
// TODO Use fields...
}
dependencies {
...
compile 'com.jakewharton:butterknife:8.6.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
}
정상적으로 동작 하지 않을 경우 다음 설정이 되어있는지 확인한다. File > Other Settings > Default Settings > Build, Execution, Deployment > Compiler > Annotation Processors 에서 "Enable annotation processing"를 체크해준다.
public class BasicWithButterKnifeActivity extends AppCompatActivity {
@BindView(R.id.text_change_view)
TextView changeView;
@BindString(R.string.str_basic)
String strChanged;
@BindColor(R.color.colorBasicChanged)
int colorChanged;
@OnClick(R.id.button_change_text)
void changeText() {
changeView.setText(strChanged);
}
@OnClick(R.id.button_change_color)
void changeColor() {
changeView.setBackgroundColor(colorChanged);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_basic);
ButterKnife.bind(this);
}
}
class RecyclerWithButterKnifeViewHolder extends RecyclerView.ViewHolder {
@BindView(R.id.txt_item)
TextView text;
String item;
RecyclerWithButterKnifeViewHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
}
void bind(final String item) {
this.item = item;
}
@OnClick(R.id.btn_item)
void clickButton() {
text.setText(getItem());
}
private String getItem() {
return this.item;
}
}
public class FragmentB extends Fragment {
@BindView(R.id.txt_description)
TextView description;
@BindView(R.id.img_view)
ImageView image;
@BindString(R.string.str_frag_b)
String strDescription;
@BindDrawable(android.R.drawable.star_big_on)
Drawable drawable;
private Unbinder unbinder;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.layout_fragment, container, false);
unbinder = ButterKnife.bind(this, view);
description.setText(strDescription);
image.setImageDrawable(drawable);
return view;
}
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug minifyEnabled false zipAlignEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}
android:sharedUserId="android.uid.system"
| $ openssl pkcs8 -inform DER -nocrypt -in testkey.pk8 -out testkey.pem | |||||||||||||
| $ openssl pkcs12 -export -in testkey.x509.pem -inkey testkey.pem -out testkey.p12 -password pass:android -name androiddebugkey | |||||||||||||
| $ keytool -importkeystore -deststorepass android -destkeystore testkey.jks -srckeystore testkey.p12 -srcstoretype PKCS12 -srcstorepass android | |||||||||||||