Mayank
1 min readAug 7, 2019

--

Thank you so much :)

To get most accurate user position everytime user presses a button, follow these steps:

  1. Go to https://github.com/mumayank/AirLocation#usage (See section Usage), and as written there, do the following:
  2. Declare airLocation in your activity
  3. Override onActivityResult and call airLocation.onActivityResult inside it
  4. Override onRequestPermissionsResult and call airLocation.onRequestPermissionsResult inside it

Now whenever you need the most accurate user position, simply re-initialize airLocation variable as shown in the example in the library’s Github page. In onSuccess of the callback, you will get a location object. Use this to retrieve lat and long of that location, along with other params.

--

--

No responses yet