1

I am working on Xamarin android application which uses location. The application works fine most of the time.But Sometimes it shows a different location than my current location when taken using network providers and take more than 5 mins if using gps. At the same time google maps shows the correct location in an instant. How can i share that location from google maps to my application.

Suhail Ismail
  • 55
  • 1
  • 1
  • 7

2 Answers2

2

Since you didn't say how do you get location, I assume that you used default LocationManager to get current location, did you distinguish the network for example like this?

locationManager.RequestLocationUpdates(LocationManager.GpsProvider, MIN_TIME_BW_UPDATES,
        MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
locationManager.RequestLocationUpdates(LocationManager.NetworkProvider, MIN_TIME_BW_UPDATES,
        MIN_DISTANCE_CHANGE_FOR_UPDATES, this);

It's possible that you may check this case on SO: Android GPS incorrect location data on query.

For your question, you cannot directly get current location from google maps application, but you can use it's api to get it.

You may refer to this doc to get started and to get the location, please refer to Location Data.

Grace Feng
  • 16,564
  • 2
  • 22
  • 45
0

You can get the location either from the mobile-network or from the GPS - In my experience The gps is the more accurate one to use.

Troels Thisted
  • 76
  • 1
  • 16