开发者

Android Location: ProximityAlert

for my app, I need something like a proximity alert, which is registered to LocationManager by calling:

public void addProximityAlert (double latitude, double longitude, float radius, long, expiration, PendingIntent intent);

This default alert does fire only every 4 minutes if the screen is turned off. For my app, it is necessary to request location updates only via NetworkProvider and about every minute.

Is it possible to custimize the default settings, or do I have to create my own alert by requesting updates li开发者_Python百科ke I want it to?

Thanks in advance, Jonathan


Since the addProximityAlert uses both the providers internally (network as well as gps) and you cannot specify these, I don't see a way to configure this method. The requestLocation updates can be used with network only provider and then you can use the Haversine formula to calculate the distance difference.

The requestLocation updates states that values under 60000ms are not recommended though !

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜