Android: How to reset and download A-GPS data?

后端 未结 2 863
旧巷少年郎
旧巷少年郎 2020-12-13 11:19

How can I programmatically reset and download new A-GPS data in an Android application? In other words, how do the \"Manage A-GPS state\" tools work in the GPS Status &

2条回答
  •  旧巷少年郎
    2020-12-13 12:11

    So far, the best answer to my question seems to be a combination of @Geobits' response and the XTRA injection code discussed in Problems with sendExtraCommand and force_xtra_injection. Based on this, I am currently using the following:

    locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
    locationManager.sendExtraCommand(LocationManager.GPS_PROVIDER,"delete_aiding_data", null);
    Bundle bundle = new Bundle();
    locationManager.sendExtraCommand("gps", "force_xtra_injection", bundle);
    locationManager.sendExtraCommand("gps", "force_time_injection", bundle);
    

    If anyone has additional ideas on how to improve this, or how to determine the best times to clear and download new GPS data, I would be very interested to hear.

提交回复
热议问题