Reduce friction with the new Location APIs


The new APIs do not require your app to manually manage a connection to Google Play services through a GoogleApiClient. This reduces boilerplate and common pitfalls in your app.   A better developer experience The new LocationServices APIs are much simpler and will make your code less error prone. The connection logic is handled automatically, and you only need to attach a single completion...

Drawable Animation


Drawable animation lets you load a series of Drawable resources one after another to create an animation. This is a traditional animation in the sense that it is created with a sequence of different images, played in order, like a roll of film. The AnimationDrawable class is the basis for Drawable animations. While you can define the frames of an animation in your code, using the...

Abstract class to get a address from current location in Android


public abstract class ReverseGeocoderTask extends AsyncTask<Void, Void, String> { private static final String TAG = "ReverseGeocoder"; private String value = "Checking your location..."; public abstract void onAddressFound(String address); private float mLat; private float mLng; private Activity mContext; public ReverseGeocoderTask(Activity context, Location location) { mContext = context;...

Volley Library to make network connection from Android App


Android volley is a networking library was introduced to make networking calls much easier, faster without writing tons of code. By default all the volley network calls works asynchronously, so we don’t have to worry about using asynctask anymore. Volley comes with lot of features. Some of them are 1. Effective request cache and memory management 2. Cancelling the requests To use volley library...

Make future payment using Braintree payment gateway


This tutorial is for those who are developing a mobile application and they want to charge a customer(one or more time) in future. In this tutorial I am going to explain backend functionality in details. Most of the time we need charge to  customer  in future. Some developers may store details in the database but this is not the best way when it comes to security. Fortunately this feature is...

Creating Custom Apex REST APIs with


Suppose we want to expose Opportunity object through Rest Web Service. Step 1 : Create a class like below @RestResource(urlMapping=’/FieldOpportunity/*’) global with sharing class RESTOppController { @HttpGet global static List<Opportunity> getOpenOpportunities() { String OpportunityName = RestContext.request.params.get(‘OpportunityName’);...

Use of basic Authentication for post URL


To mark all url in application authenticate, use of basic authentication could good option. In Below example I used Username and Password to generate Authentication header .   String authentication = editusername.getText().toString().trim()+”:”+editpassword.getText().toString().trim(); String authHeader =Base64.encodeToString(authentication.getBytes(), Base64.NO_WRAP);   Use...

Rotate the Activity.


To rotate Activity around it’s X-axis use Activity Switcher class. For Animation Out: ActivitySwitcher.animationOut(findViewById(, getWindowManager(), new ActivitySwitcher.AnimationFinishedListener() { @Override public void onAnimationFinished() { startActivity(intent); } });   For Animation In: ActivitySwitcher.animationIn(findViewById(

Communication between Bluetooth devices


I had used this communication to get the surrounding temperature, but we can also use this to develop chat room which will be offline. BluetoothSPP bt; //Bluetooth Socket bt = new BluetoothSPP(this); //initilisation // check weather Bluetooth is on/off   if (!bt.isBluetoothEnabled()) { Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); startActivityForResult(intent...