天天看點

gps的冷啟動

android gps的冷啟動方法:

LocationManager locMan;

locMan = (LocationManager)getSystemService(Context.LOCATION_SERVICE); 

  locMan.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 0, gpsListener);

  locMan.addGpsStatusListener(statusListener);

locMan.sendExtraCommand(LocationManager.GPS_PROVIDER, "delete_aiding_data", null);

public boolean sendExtraCommand(String provider,String command,Bundle extras)

Since: API Level 3

Sends additional commands to a location provider. Can be used to support provider specific extensions to the Location Manager API

Parameters
provider name of the location provider.
command name of the command to send to the provider.
extras optional arguments for the command (or null). The provider may optionally fill the extras Bundle with results from the command.
Returns
  • true if the command succeeds.