开发者

Android GPS reading control

I have a question about the GPS reading control. I use this fu开发者_开发问答nction:

requestLocationUpdates(String, minTime , minDistance, LocationListener)

If I put the minDistance=100, does it mean the GPS will read the coordinate in each 100m? Is it accurate? How does it work (how can it know if the distance from my first location to the second is 100m)?


It means it won't report a location to your listener unless it's at least 100m away from the last location it reported to you. This is useful if your app does something battery/disk/network intensive on every location update but doesn't need a very fine resolution. For example, if you want to notify the user every time they cross city lines, you don't need to run the check on their coordinates every 1 second when they've moved 6 inches; a value of 30 seconds / 100m would probably suffice.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜