how to reset the gps in android -


is there way reset gps in android ? please help. test below code not sure work or not.

for reset

locationmanager.sendextracommand(locationmanager.gps_provider,"delete_aiding_data", null);

for download gps data

public static void downloadgpsxtra(context context){

 locationmanager locationmanager1 = (locationmanager)context.getsystemservice("location");  bundle bundle = new bundle();  locationmanager1.sendextracommand("gps", "force_xtra_injection", bundle);  locationmanager1.sendextracommand("gps", "force_time_injection", bundle);      } 

and add permission statements in android menifest.

"access_location_extra_commands"

android location manger uses multiple sources location

data network (coarse location upto city level using ip geolocation)

network provider (coarse location upto 100 meters using cell towers)

gnss(fine upto 3 meters using gps / glonass / galileo on gnss chip)

location manager encapsulation of hardware,you cannot access chip. gnss chips lose tracking of satellites in urban areas due obstacles often. using multiple sources helps android keep track of location when tracking satellites lost.

locationmanager1.sendextracommand("gps", "force_xtra_injection", bundle); locationmanager1.sendextracommand("gps", "force_time_injection", bundle);

here downloading a-gps data , synchronising gps time.

what doing force loading a-gps data.without a-gps data time first-fix chip ranges 3-20 minutes. a-gps can reduced matter of 32 seconds.

[there apps need rooting , can change a-gps loading locations]

location manager heavily depends upon 'last know best location'. doing right , should work in improving accuracy extent. depending upon device can see results.

on hardware level there minimum of 3 meters error( can range upto 50 meters) @ given location, should taken consideration when distance calculated.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -