Open In App

How to Use ButterKnifeZelezny X Plugin in Android Studio?

Last Updated : 02 Nov, 2021
Like Article

Laziness is one of the most powerful properties of a good programmer, most android developers know about JakeWharton’s ButterKnife annotation library. Without writing repeated elements like findViewById() and setONClickListner(), we use this library, so it can reduce the developer burden to write the same code again and again when there are many views in the layout that need to get references through findViewByID(). The 7 features of butterknife plug-ins are:

  1. Optimize your code.
  2. Binding View.
  3. Also Binding resources.
  4. Provide an event listener.
  5. Provide List adapter.
  6. Provide RecyclerViewAdapter.
  7. Setting View property.

How to Use ButterKnifeZelezny X Plugin in Android Studio

Step 1: Install the plugin in android studio

Open your Android Studio and go to the setting > plugins as shown below image.

Note: You may refer to How to Install and Uninstall Plugins in Android Studio? to Install and Uninstall Plugins in Android Studio.

Search Android ButterKnife Zelezny in plugins marketplace and install the plugin. After completing installation restart the IDE.

Step 2: Open an existing or new project

Go to the build.gradle for dependency.

add dependencies:

dependencies { implementation file tree(dir: ‘libs’, include:[‘*.jar’]) implementation ‘com.jakewharton:butterknife:7.0.1’   

Step 3: Open file or any activityjava file where you want to add library

Right Click on XMl file notation as shown in above figure, and select insert > Generate butterKinfe injection

Step 4: Select Elements and click on confirm button.

Step 5: Your injection is successfully implemented as shown in figure.

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads