Sunday, July 19, 2020

How to Check GPS Status in Android

How to check GPS/ Location Service is Enabled in Android



In Android, It is very easy to check whether GPS or Location Service are enabled or not.

For this we need to declare Location related permission in Manifest

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>


Method to check GPS in ANDROID


public boolean checkGPSGPSEnabled()
{

    LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
    boolean isGPSenabled = lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
    Log.i("KAMLESH","Location Enabled "+isGPSenabled);
    return isGPSenabled;
}

5 comments:

  1. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. บาคาร่าออนไลน์

    ReplyDelete
  2. Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!Thanks 토토랜드

    ReplyDelete
  3. This particular is usually apparently essential and moreover outstanding truth along with for sure fair-minded and moreover admittedly useful My business is looking to find in advance designed for this specific useful stuffs… 메이저놀이터

    ReplyDelete
  4. We are looking for a lot of data on this item. In the meantime, this is the perfect article I was looking for . Please post a lot about items related to 안전놀이터!!! I am waiting for your article. And when you are having difficulty writing articles, I think you can get a lot of help by visiting my .

    ReplyDelete
  5. I really like you words and appreciate your article post. Really Cool please keep writing.

    ReplyDelete