Tag Archives: Location Service

How to Check whether is GPS is enabled in your android device?

By | June 3, 2012

This simple code checks whether GPS in enabled in your android device or not. If the GPS is not enabled the user is redirected to the settings page. [java] LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE); boolean enabled = service.isProviderEnabled(LocationManager.GPS_PROVIDER); // Check if enabled and if not send user to the GPS settings if (!enabled) { Intent intent = new… Read More »

How to check whether GPS is available in ANDROID or Not?

By | February 24, 2011

This code helps you to check whether the location service is available on your ANDROID Phone or not. Copy this code and paste to your file. Happy coding….. [java] public boolean GPSAvailable() { LocationManager loc_manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); List<string> str = loc_manager.getProviders(true); if(str.size()>0) return true; else return false; } [/java]