Posts

Showing posts from September, 2015

How to do Facebook Login with Custom Button Android

In my previous Facebook Post( http://androidammy.blogspot.in/2015/07/facebooklogin1.html ). I write how to use Facebook default button to login with Facebook. In this blog I am writing about how we can use facebook login functionality from android widget like Button/TextView/ImageView. All the steps are same as last facebook login post. This blog describe that  how to create instance of CallBackManager and LoginManager and how to call Login from click listener. 1.  Create Instance of LoginManager and CallbackManager. com . facebook . login . LoginManager fbLoginManager ; fbLoginManager = com . facebook . login . LoginManager . getInstance (); CallbackManager callbackManager = CallbackManager . Factory . create (); mFbLoginManager . registerCallback ( callbackManager , new FacebookCallback < LoginResult >() { @Override public void onSuccess ( LoginResult loginResult ) { // here write code

Easy way to convert Json to Pojo/Model class of Java

Is It hard for you to create Pojo/Model/Bean classes according to Json result specially when you are using third party libraries like GSON/Jackson? There is very easy and fast way to create Pojo/Beans/Model classes for Json Schema.  Check out the below link to convert your Json response to Java model classes.   http://www.jsonschema2pojo.org/ For Example I want to convert  json data to Gson Pojo class then following are the points to do it. 1. Copy and paste Json to TestEditor displayed in link. 2. Enter my package name and class name. 3. Select Source type to Json. 4. Select annotation style to GSON. Its done here.  Preview the Class structure and copy paste to your model class. Happy Coding :D