protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_base); ButterKnife.bind(this); } @OnClick(R.id.nav_home) public void goToHome() { //Code to run on click of home }
calls • No Need to write setOnClickListener • Group click handler listeners • Cleaner code overall • Loads of other convenience annotations Cons • Issue with RecyclerViews click handling • Major changes between versions • Runtime errors
done for you • Pluggable infrastructure • Ability to add network interceptors (e.g. Stetho) • Bundle with OkHttp3, Okio, Moshi for a world class network architecture • Cleaner code overall • Loads of other convenience annotations Cons • None that I could find
for TAG • Awesome way to log errors • Gives you control when and where logs will appear • Pluggable Infrastructure e.g. Crashlytics • Great Open Source project to learn from Cons • None that I could find
cancellation in list adapters • Auto managed memory • One of the best ways to handle images in the most optimised way • Disc & Memory caching Cons • None that I could find
way to handle network requests • Supports the latest Web protocol standards like HTTP/2, SPDY etc • Updated outside the platform to get the latest version • Better handles exceptional cases • Asynchronous built in Cons • None that I could find
// Name cannot be null private String name; private int age; } Dog dog = new Dog(); dog.setName("Rex"); dog.setAge(1); RealmConfiguration realmConfig = new RealmConfiguration.Builder(context).build(); Realm realm = Realm.getInstance(realmConfig); realm.beginTransaction(); realm.copyToRealm(dog); realm.commitTransaction(); final RealmResults<Dog> puppies = realm.where(Dog.class).lessThan("age", 2).findAll();
the things • Ridiculously easy to read & write data • Much natural way of thinking about data storage • Faster than Ferrari Cons • Unstable API’s. Still under active development • Easy to forget about read/write state conflict