Android examples for Hardware:Gps
This Function check the GPS enable/disable Status.
//package com.java2s; import android.content.Context; import android.location.LocationManager; public class Main { /**// ww w.j ava2s.co m * This Function check the GPS enable/disable Status. Remember to add * required Permission in Manifest. * * See below for @params. */ public static boolean isGPSEnable(Context ctx) { LocationManager locationManager = (LocationManager) ctx .getSystemService(Context.LOCATION_SERVICE); return locationManager .isProviderEnabled(LocationManager.GPS_PROVIDER); } }