开发者

Is there an Android service or app that is similar to the IOS significant-change location service?

The IOS significant-change location service would work nice开发者_开发百科ly for my app to monitor location changes while preserving battery life.

Is there a similar service for Android or is there a third party app available?


Use the Criteria class to specify your requirements.

Criteria criteria = new Criteria(); 
criteria.setAccuracy(Criteria.ACCURACY_COARSE);
criteria.setPowerRequirement(Criteria.POWER_LOW); 
...
String bestProvider = myLocationManager.getBestProvider(criteria, true);

Reference for Criteria http://developer.android.com/reference/android/location/Criteria.html


Perhaps a third-party service, but you can use the Locator Manager's RequestLocationUpdates functionality to specify the period/magnitude of location change you want.

I'd say its a development-related question.


From iOS documentation

This interface delivers new events only when it detects changes to the device’s associated cell towers, resulting in less frequent updates and significantly lower power usage.

I think this stackoverflow post answers this better

Best Practice to report user location continuously


The reality is that android used to let you do whatever you wanted: write a service, have it get the User's location continuously until the battery died. Starting with around N, that all went away. Now with O and P, they tell you point blank in their guidelines for what you can expect when being in the background:

Background Location Limits

In an effort to reduce power consumption, Android 8.0 (API level 26) limits how frequently background apps can retrieve the user’s current location. Apps can receive location updates only a few times each hour.

So the answer is no. In iOS, you can still monitor the User's location from the background and the whole point of the Significant Change service is to allow you to do so efficiently.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜