java - Methods for giving best estimate of Location from three Android location providers -


after reading older post, good way of getting user's location in android , wondered if has theories on how solve problem finding best estimate of location. gps ideal assume second gives bad measure every often.

lets 3 measures, gps, wifi, , cell tower degrees of accuracy, methods might suggest find "best" location?

my initial reaction type of weighted centroid function have 3 points , assign weights 3 accuracy , find closest point 3 points given accuracies. other thought use machine learning seems excessive unless i'm making solve problem. thoughts? based on me wondering how skyhook solves problem using data.

//declare constants   // minimum distance change updates in meters private static final long min_distance_change_for_updates = 20; // 10 meters   // minimum time between updates in milliseconds private static final long min_time_bw_updates = 2000 * 60 * 1; // 1 minute  public void getlocation()  {       locationmanager = (locationmanager) getsystemservice(context.location_service);     // define criteria how select locatioin provider             criteria criteria = new criteria();     provider = locationmanager.getbestprovider(criteria, false);     locationmanager.requestlocationupdates(provider, min_time_bw_updates,                   min_distance_change_for_updates, this);      if (locationmanager != null) {     location location = locationmanager.getlastknownlocation(provider);         if (location != null) {           loclat = location.getlatitude();           loclong = location.getlongitude();                                        }    } } 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -