Monday, 10 July 2017

Android library worth using

Android library worth using:

Every Android developer should use these libraries in their projects. These libraries reduce code boilerplate and provide many other advantages.


1. Data Binding:

It helps you to write declarative layouts and minimize the glue code necessary to bind your application logic and layouts.
The Data Binding Library offers both flexibility and broad compatibility — it's a support library, so you can use it with all Android platform versions back to Android 2.1 (API level 7+).

Reference Link: [https://developer.android.com/topic/libraries/data-binding/index.html]


2. Butter Knife:

Field and method binding for Android views which uses annotation processing to generate boilerplate code for you.
  • Eliminate findViewById calls by using @BindView 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.
Reference Link: [https://github.com/JakeWharton/butterknife]

3. Retrofit:

Retrofit is a REST Client for Android and Java by Square. It makes it relatively easy to retrieve and upload JSON (or other structured data) via a REST based webservice. In Retrofit you configure which converter is used for the data serialization. Typically for JSON you use GSon, but you can add custom converters to process XML or other protocols. Retrofit uses the OkHttp library for HTTP requests.

Reference Link: [http://www.vogella.com/tutorials/Retrofit/article.html]


4. Rx-Android:

https://www.raywenderlich.com/141980/rxandroid-tutorial


5. Dagger 2:

Dagger 2 is dependency injection framework. It is based on the Java Specification Request (JSR) 330. It uses code generation and is based on annotations. The generated code is very relatively easy to read and debug.

Reference: [http://www.vogella.com/tutorials/Dagger/article.html]

6. Room:

Room provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite.

Reference: [https://developer.android.com/topic/libraries/architecture/room.html]


7. Glide/Picasso:

Glide: Glide is a fast and efficient open source media management and image loading framework for Android that wraps media decoding, memory and disk caching, and resource pooling into a simple and easy to use interface.

Picasso: Images add much-needed context and visual flair to Android applications. Picasso allows for hassle-free image loading in your application—often in one line of code!

Friday, 19 May 2017

Android Kotlin

Adding Kotlin langauge support in Android Studio

Go to File -> Settings -> Plugin -> Browse Repositories -> Search Kotlin -> Install Kotlin plugin -> Restart Android Studio

Convert java code into Kotlin code

Goto Android studio code menu -> Convert java to kotlin