open GPS - Android android.location

Android examples for android.location:GPS

Description

open GPS

Demo Code

import android.content.Context;
import android.location.LocationManager;

public class Main {

  public static boolean openGPS(Context context) {
    LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
    if (locationManager.isProviderEnabled(android.location.LocationManager.GPS_PROVIDER)
        || locationManager.isProviderEnabled(android.location.LocationManager.NETWORK_PROVIDER)) {
      return true;
    }/*from www  .j a v  a 2  s  .c om*/
    return false;
  }

}

Related Tutorials