我是android新手。我想將緯度經度發送給定期更新的網絡服務,時間間隔爲15分鐘。即使我的設備處於精彩模式,即使我的應用程序未處於活動狀態。即使手機長時間不移動,即使用戶移動速度很快。提前致謝。
0
A
回答
1
這裏有你需要的;)
http://developer.android.com/guide/topics/location/obtaining-user-location.html
這行代碼上的頁面設置更新率。
// Register the listener with the Location Manager to receive location updates
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);
這裏是它如何工作
http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates(java.lang.String, long, float, android.app.PendingIntent)
但切記要停止的位置更新,不需要他們的時候索姆更多的信息,它是在電池重
1
OK,
1.Lets start from the first, "periodically update at time interval of 15 minute"
->for this we already suggest you to use service and timer or alarm manager.
2. "Even if my device is in spleep mode".
-> For this you prevent to going your device in sleep mode for that you can use android's WAKE_LOCK.
3. "Even if my application is not active".
-> I think for this, you can start a service at the device boot time, and it is countinuesly going to run..
4. "Even if phone is not moving for long period.Even if user is moving fast".
-> for this from service save your lat,long at every 15 minutes and also check whether
location is updated or not if updated then just update your lat,long also, and then just
send the lat, long for every 15 minutes.
希望大家能夠理解,謝謝,
+0
非常感謝。 – Manisha
+0
嗨,我可以知道如何更新當前活動的地圖視圖與最新的地點,這是由「服務」根據您的上述答案檢索。 –
相關問題
- 1. 使用經緯度
- 2. 使用經緯度
- 3. 如何在java中使用緯度和經度獲取位置?
- 4. 如何使用緯度和經度計算距離和方位?
- 5. 從Geocoder獲取經度和緯度值的位置更新
- 6. 使用Javascript來獲取經緯度
- 7. 如何獲得客戶的地理定位(經度和緯度)非常快?
- 8. 更改座標經緯度和緯度
- 9. Facebook API:如何發佈狀態更新的位置(緯度+經度)?
- 10. 位置服務,如何在一段時間(30秒)後更新緯度,經度?
- 11. 如何查找特定位置的經度和緯度?
- 12. 如何確定我的當前位置(經度和緯度)?
- 13. 緯度經常變化
- 14. 如何非常有效地分配經緯度描述的經緯度?
- 15. 如何使用經緯度數據
- 16. 更新以前的經緯度
- 17. 刷新經緯度或加載更快
- 18. 如何使用GEONAMES數據來確定的郵政編碼緯度和經度?
- 19. Google API在指定的經緯度位置拋出異常?
- 20. C++如何使用經度和緯度確定時區
- 21. jquery更新經緯度和經度的HTML格式
- 22. 使用經緯度編號
- 23. 如何獲取經度和緯度後的用戶位置
- 24. 如何根據位置緯度經度限制用戶登錄
- 25. 如何從Facebook用戶位置獲取經度和緯度?
- 26. 如何經緯度ArryList複製到另一個經緯度ArryList
- 27. 如何在經緯度中嵌入經緯度網址
- 28. 近緯度經緯度
- 29. 如何轉換經緯度?
- 30. 如何獲取經緯度?
我想我涵蓋整個思考你需要什麼。 – user370305