Java tutorial
//package com.java2s; import android.location.LocationManager; import android.util.Log; public class Main { public static boolean displayGPSStatus(LocationManager locManager) { boolean gps_enabled = false; try { gps_enabled = locManager.isProviderEnabled(LocationManager.GPS_PROVIDER); } catch (Exception ex) { Log.i("GPSStatus", " checking GPSStatus throws error " + ex); } return gps_enabled; } }