简体   繁体   中英

Is there any way to implement proximity alert via a service in android?

我正在制作一个从用户获取位置的应用程序以设置近距离警报,但问题是该应用程序仅在其在前台运行时才触发警报...。当用户通过按后退按钮退出时,该应用程序不显示任何警报,即使应用程序不在前台,我也想继续检查近距离通讯,我尝试将近距离通讯放入服务中,但根本无法使用...请提出任何建议!

I think what you want to implement is covered by Geofencing in Android. You can take a look here https://developers.google.com/android/reference/com/google/android/gms/location/GeofencingApi or here http://www.technology-ebay.de/the-teams/mobile-de/blog/geofencing-in-the-mobile-de-android-app.html .

In short, you define a location and a radius, and if an event is triggered (entering or exiting the area) you get notified.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM