Android examples for Hardware:Gps
is Gps Enabled
//package com.java2s; import java.util.List; import android.content.Context; import android.location.LocationManager; public class Main { public static boolean isGpsEnabled(Context context) { LocationManager locationManager = ((LocationManager) context .getSystemService(Context.LOCATION_SERVICE)); List<String> accessibleProviders = locationManager .getProviders(true);/* w ww. j av a 2 s .co m*/ return accessibleProviders != null && accessibleProviders.size() > 0; } }