Category Archives: GPS

How to find your Google Plus ID

This is so simple

1. Go to your Google + account (https://plus.google.com/).

2. Click on the Profile icon on the Left.

3. If you look at the URL in the address bar, it should look something like this:

https://plus.google.com/104653270154306099169/posts

4. The long numerical string in the URL is your Google+ ID. Here is CoderzHeaven’s from the URL above:

104653270154306099169/

Google + CoderzHeaven

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

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.

  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 Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
        	startActivity(intent);
        }

Turn off the GPS on your device and running it will display this screen.

Please test GPS on the device because emulators don’t have GPS. But anyway you can simulate Longitude and Latitude which I will show in the coming posts.

GPS

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

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…..

 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;
}