0
我無法將服務商從GPS切換到網絡後臺service.Gith幫助GPS提供商我得到定期更新的位置使用後臺服務,但當GPS關閉,然後如何獲取緯度&經度的更新位置?如何在Android中使用網絡提供商的後臺服務獲取更新位置?
我無法將服務商從GPS切換到網絡後臺service.Gith幫助GPS提供商我得到定期更新的位置使用後臺服務,但當GPS關閉,然後如何獲取緯度&經度的更新位置?如何在Android中使用網絡提供商的後臺服務獲取更新位置?
您應該使用的LocationManager在服務
LocationManager locationManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this);
}
@Override
public void onLocationChanged(Location location) {
Log.i("location...","...latt"+location.getLatitude()+"longg..."+location.getLongitude());
String my_latitude = String.valueOf(location.getLatitude());
String my_longitude = String.valueOf(location.getLongitude());
}
你必須使用一個GeoIP的服務。 – planetmaker
和你的問題是什麼? – shmoula
如何在android中使用GeoIP服務? – AmolRaj