This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// check if a compatible play services is available on the device | |
// if not, show a dialog that takes the user to Google Play Store | |
// to install the required play service | |
private boolean checkPlayServices() { | |
int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this); | |
if (status != ConnectionResult.SUCCESS) { | |
if (GooglePlayServicesUtil.isUserRecoverableError(status)) { | |
showErrorDialog(status); | |
} else { | |
Toast.makeText(this, "This device is not supported.", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Location Intent Service | |
*/ | |
import android.app.IntentService; | |
import android.app.PendingIntent; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.location.Location; | |
import android.support.v4.content.LocalBroadcastManager; |