Tuesday, October 25, 2016

Tips to use ButterKnife - Dependency Injection in Android

http://www.andolasoft.com/android-application-development/

What is Dependency Injection? 

It's a design pattern in Android that allows writing codes for low coupling and also makes it possible to change them any time.

Benefits:
  • Promotes loose coupling between classes and subsystems
  • Easy to use and modify the components
  • Testing the functionalities is easy too
Libraries available in Android:
  1. ButterKnife
  2. Roboguice
  3. Android Annotations
  4. Dagger 2
Dependency Injection with ButterKnife :

ButterKnife helps to represent the views from an activity or fragment and also helps in handling various events like onClick(), onLongClick() etc. through annotations.

No comments:

Post a Comment