Sunday, 26 June 2016

  1. Retrofit/Volley :- Networking libraries which ease your task of writing long network requests and related boiler-plate code.
  2. Picasso/Glide :- Loading image into imageview from an url is made very simple using any one of these.
  3. Simple Facebook :- Will relatively ease your burden of implementing facebook social login.
  4. ActiveAndroid/GreenDAO :- Reduces the boilerplate code required for interacting with local Sqlite database.

Volley Vs Retrofit

Volley has flexible caching mechanism whereas Retrofit does not provide support for caching.

Volley support retrying mechanism whereas Retrofit does not provide support for retrying.

Volley is a networking library, developed by Google engineers. 
It was introduced in Google IO 2013, it offers great features like synchronous requests, asynchronous requests, 
prioritization, making multiple requests at the same time, ordered requests and of course caching. But one of the major problems faced by 
developers using this library is that it lacks detailed official documentation. 


On the other hand Retrofit is a clean, simple, and light library for Android by Square, Inc. 
In other words, Retrofit is a REST client for Android, through which you can make easy to use interfaces which can turn 
any Android app into a powerful one. What makes it different is that, Retrofit can perform Async and sync requests with automatic 
JSON parsing without any effort. This feature alone makes it powerful enough to make a contender for this comparison. 


2) In-Built Request Types
The data returned from a web service always complicates the implementation, but thankfully now with help of these libraries almost all types of responses can be captured. Android Volley can capture four types of responses automatically through these requests:

StringRequest – Make this type of request and the returned data is parsed and converted in to a String.
JsonObjectRequest – This type of request converts the response in to a JSONObject.
JsonArrayRequest – Make this type of request and response is automatically converted into a JSONArray.
ImageRequest – This type of request converts the response into a decoded bitmap automatically.
On the other hand Retrofit can parse many other types of responses automatically like:

Boolean – Web API response needs to be a String boolean.
Integer – Web API response needs to be an integer.
Date– Web API response should be Long format date.
String – Web API response needs to be in String format.
Object – Web API response needs to be in Json object.
Collections – Web API response needs to be in a String Format.

Two methods of passing object by Intent (Serializable,Parcelable)
https://www.javacodegeeks.com/2014/01/android-tutorial-two-methods-of-passing-object-by-intent-serializableparcelable.html


Transient variables value will not be saved to file and hence cannot be retrieved in the new object. Similarly static variable values are also not serialized since they belongs to class and not object.


A Service helps you to execute tasks in the background. Like downloading a file or tracking user location changes.
It is an Application Componenet with no user interface. It has a simple life cycle and comes with a set of features.
There are two types of Services
Bound Service  This kind of service is bound to a component like an Activity and runs as long as the Activity runs.
Started Service  This kind of service can run indefinitely. Even when the Activity that started is is destroyed.
You can create a new service by extending either the Service Class or the IntentService Class.

IntentService allows you to create a started service.



One of the major changes in Android Marshmallow is the new permission system. In earlier versions we were declaring the permission in the AndroidManifest.xml file. But with Android Marshmallow we need to ask the permission at run time.  In this post I will show you a simple Android Marshmallow Permissions Example. So lets begin.

Material Design, its a comprehensive guide of UI Widgets introduced since Android 5.0 and it improves the visual appeal of the apps.




Android’s latest release, Lollipop (Android 5.0 API Level 21) includes the new RecyclerView and CardView widgets. They’re also made available for use on devices running API Level 7 and above through the Support Libraries.
The RecyclerView provides a more advanced and flexible way of displaying lists than the old ListView.
The CardView widget enables you to display views inside a card. You can design the card so that its look is consistent across your app.

Displaying Lists

The RecyclerView widget is essentially a container that you can use to display large sets of data. It’s very efficient as it only displays a few items at a time. Views that are no longer needed are recycled and reused. Not having to keep on inflating views saves CPU resources and valuable memory is saved by not having to keep views alive in the background.


Android RecyclerView is a more advanced, powerful and flexible version of the ListView. RecyclerView is similar to ListView when it comes to implementation except the fact that it forces us to use a RecyclerView.ViewHolder class to hold the elements which was not a compulsion in ListView.
As the name suggests, a RecyclerView is used to reuse cells when scrolling up and down by recycling the items in the list. Another improvement in RecyclerView is that it allows us to set the LayoutManagers dynamically at runtime unlike the ListView which was only available in a Vertical scrolling List. RecyclerView allows us to set the following types of Layouts at runtime.
  • LinearLayoutManager : it supports both vertical and horizontal lists
  • StaggeredLayoutManager : it supports staggered lists
  • GridLayoutManager : it supports displaying grids as seen in GalleryView earlier

The RecyclerView.ItemAnimator class provides better support to animating the views unlike the ListViews









  • The RecyclerView.ItemDecorator class provides better support when it comes to adding borders and dividers thereby giving huge control to us
  • Hence a RecyclerView is more customisable when compared to ListView and gives greater control to the users.
    The RecyclerView is available in the support library. So we need to modify our gradle script to add the following dependency.
    1
    2
    3
    dependencies {
           compile 'com.android.support:recyclerview-v7:21.0.0-rc1'
     }


    CardView widget allows us to control the background color, shadow, corner radius, elevation etc. For using the custom attributes in XML, we need to add the following namespace declaration to the parent layout.


    The important attributes used above are:
    • card_view:cardCornerRadius : Used to set the corner radius in our layouts
    • card_view:cardBackgroundColor : Used to set the background color of the view



    Firebase is a cloud service provider. It is now under google and this service can replace your whole server side part of your application. In many tutorials we had used MySQL and PHP for our database. But if we will use Firebase we do not need any server side code or configuration. We can directly use firebase. Firebase comes with a bundle of many features.

    Features of Firebase?

    firebase features




    No comments:

    Post a Comment

    Pass a HashMap from Angular Client to Spring boot API

    This example is for the case where fileData is very huge and in json format   let map = new Map<string, string>()      map.set(this.ge...