1

I'm developing an Android app and I need some help to save GPS coordinates for a route... coordinates are very important for my app, so: how can I do in order to get very good coordinates (especially at a first try)? How can I understand whether the position is correct or not? How can I use getAccuracy method or similar to figure out whether the position is wrong so that I have to reject it?

For example: I get a 1st LatLng coordinate but the 2nd LatLng is located 100 meters away from the 1st coordinate, so I guess that is very unlikely that a user can move 100 meters away in a few seconds... how can I create such an alghoritm?

Nammen8
  • 619
  • 1
  • 11
  • 31

1 Answers1

0

Android Defining a Model for the Best Performance to get location

http://developer.android.com/guide/topics/location/strategies.html#BestPerformance

Sahir Saiyed
  • 518
  • 8
  • 17
  • Hi,thanks for your reply... sometimes I get false coordinate, like I said especially at a first try... for example it use the last WiFi MACID but if I'm in another city my route is wrong bad... do you say with this implementation I won't have this problem again? – Nammen8 Jun 26 '15 at 15:20
  • this is special case. i implement this algorithm one of my application (mobile spy) and i got best result. false coordinate may be depends on devices. – Sahir Saiyed Jun 27 '15 at 11:06
  • Can you suggest me something to do with devices? I'm thinking to use (if there is) step counter or acceleration sensor to check if there is some suspicious coordinates. Thanks again – Nammen8 Jun 29 '15 at 07:55
  • did you write your logic in onLocationChanged ? – Sahir Saiyed Jun 29 '15 at 11:40
  • `@Override public void onLocationChanged(Location location) { if ( location.hasAccuracy() && location.getAccuracy() < MINIMUM_ACCURACY ) { if (isBetterLocation(location, currentBestLocation)){ //handle new location } } }` – Nammen8 Jul 02 '15 at 10:07