10 shortcuts can help you to complete your project within deadline without doing much coding in android

Today I am going to write some shortcuts that can really help you to boost up your performance and can help you to save from labour works . I am listing out some important libraries and plugins here.

1:ButterknifeView "injection" library for Android ):
Field and method binding for Android views which uses annotation processing to generate boilerplate code for you.
  • Eliminate findViewById calls by using @Bind on fields.
  • Group multiple views in a list or array. Operate on all of them at once with actions, setters, or properties.
  • Eliminate anonymous inner-classes for listeners by annotating methods with @OnClick and others.
  • Eliminate resource lookups by using resource annotations on fields.
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.jakewharton:butterknife:7.0.1'   
}
2:Gson library : 

 Gson is a Java library that can be used to convert Java Objects ( Pojo or JavaBean or Model class etc) into their JSON representation and vise versa .  Gson can work with arbitrary Java objects including pre-existing objects that you do not have source-code of.
To use this you need to add Gradle dependency your project gradle.

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
  
    compile 'com.google.code.gson:gson:2.2.4'   
}


3: Json To Pojo (Model) generator : 

To use gson we need to create some pojo( Model ) classes. We have to write lot of key variables name with respective datatypes. to Avoid this you can use jsonschema2pojo , using this you can generate model classes with annotation for different usage i.e gson , Jackson etc.

4: Android Parcelable Code generator :

You can also make any class parcelable without writing any code by using parcelable code generator plug in which you need to download from you plug in section. 

Ubantu/Window android studio :
File ->Settings-> plugins-> search "parcelable code generator" -> download and restart your android studio.

Go to the class and right at anywhere and pick generate -> at bottom choose parcelable -> see the result

5: Android ButterKnife Zelezny: 

To generate generate Butterknife annotation automatically we have plugin for this as well .
Ubantu/Window android studio :
File ->Settings-> plugins-> search "Android ButterKnife Zelezny" -> download and restart your android studio.

Go to Activity or adapter where we had inflated layout and right over layout -> generate-> pick butterknife option to generate all view variables w.r.t there id's Bingo.

6: Glide (The Image loader) :

Glide  is very powerful image loader , has lot of image loading options you can see all the Example codes here.
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.github.bumptech.glide:glide:3.5.2'
}

7: Android Asynchronous Http Client:

For rest api call you can use most powerful library i.e android-async-http
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    
    compile 'com.loopj.android:android-async-http:1.4.9'   
}


This library also help to set custom font throughout your project by setting it at Application only.
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
   
    compile 'uk.co.chrisjenx:calligraphy:2.1.0'   
}


It is replacement of Sqlite database . This library also help you to create database by using model (pojo)classes only.

10: Android Drawable Importer :

 Plugin also help you to import drawable with suitable icon name and also manage them to w.r.t there folders i.e. hdpi,xhdpi,mdpi etc.


Please feel free to comment and ask queries.



Previous
Next Post »