android-geofence

Monitoring Location Settings in a Library

感情迁移 提交于 2019-11-27 18:17:09
问题 I'm working on a library that can be used to monitor geofences on Android devices. I've noticed that the geofences I register with Google Play Location Services GeofencingApi class are lost after I turn Location Services off and back on in the device settings. I have seen folks suggesting that I need to register for the android.location.PROVIDERS_CHANGED broadcast receiver in my AndroidManifest.xml file. I've done that -- but this broadcast receiver only gets called when I add and remove test

Are Android geofences surviving a reboot?

不羁的心 提交于 2019-11-27 16:03:04
问题 is the system persisting them or do I have to add them again them after reboot? I have not found anything about that in the documentation at https://developer.android.com/training/location/geofencing.html 回答1: Geofences will not persist on reboot. I have tested and you can find the sample here. You have to listen for BOOT_COMPLETED action and add geofences again. Note: If your app installed on external storage(SD card) , you will never receive Boot Complete action. So you have to specify

Error adding geofences in Android (status code 1000)

雨燕双飞 提交于 2019-11-27 14:17:46
I am getting an error in the onAddGeofencesResult(int statusCode, String[] geofenceRequestIds) callback with statusCode = 1000 . I have my GPS enabled and my WiFi. I also have Google Play Services and I am able to track my location and request updates. Why am I not able to add geofences? I am not able to add geofences even from the documentation sample app. I get the following Toast message: "Add Geofences: Failure, error code 1000 GeofenceRequestIds=[1,2,1,2]" From the documentation (statusCode 1000): public static final int GEOFENCE_NOT_AVAILABLE Geofence service is not available now.

How to make Geo Fencing alert more accurate in Android

走远了吗. 提交于 2019-11-27 00:58:29
问题 Hello I am trying to add feature of Geo Fence in Android. I am using the http://developer.android.com/training/location/geofencing.html for creating and monitoring Geo Fences. I am using the IntentService for the alert (Entered/Exited) but for me it is not working. But When I went away and come back into region to test it then it didn't work for me. I have turned ON the GPS of the device but device is not connected with internet. Anyone can you please help me to make it more accurate and

Geofence triggering procedure explanation needed?

浪尽此生 提交于 2019-11-26 22:18:50
问题 SO I've created geofence as below: GeofenceModel modelExit = new GeofenceModel.Builder("id_oi_456") .setTransition(Geofence.GEOFENCE_TRANSITION_DWELL) .setExpiration(Geofence.NEVER_EXPIRE) .setLatitude(40.414341) .setLongitude(49.928548) .setRadius(CLIENT_GEOFENCE_RADIUS) .build(); SmartLocation.with(this).geofencing() .add(modelExit) .start(this); I run this code once, it triggers when dwelling inside geofence (as expected). And then I delete the snippet and rerun the project. But geofence

How do I use the Android Geofencing API?

蓝咒 提交于 2019-11-26 19:44:55
问题 I have been testing the new Google Play Geofencing service API. I downloaded the sample code from the Android developers site. Next, I ran the example code on an Android device (Galaxy Note 2). I placed my office geo-position and radius to 10m, but when I walked to my office, nothing happened. While running the sample code, one thing I have noticed is that when I am already inside the geofence range and then add the geofence to LocationClient , nothing happens. I had already read

Android: Build Polygonal Shape Geofence

妖精的绣舞 提交于 2019-11-26 18:29:29
问题 According to the API documentation, only Circular shape Geofences allowed: https://developers.google.com/android/reference/com/google/android/gms/location/Geofence.Builder And it's looks for example: https://developer.android.com/training/location/geofencing.html But I have 4 locations, representing 4 corners of rectangle, and I want my Geofence to be that rectangle. I want to avoid solution of building my custom location monitoring service extending the functionality of monitoring Geofences,

Do Geofences remain active in android after a device reboot

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 17:27:45
问题 I'm writing an application that needs to use geofencing for when someone enters/exits multiple sites over the lifetime of the application being installed. My implementation of geofencing (very similar to the second link below) is all working fine when I first install the application, both when moving in/out of the geofences and when using mock locations to simulate it, until a device is rebooted. On reboot neither mock locations nor actually physically moving in and out of a geofence appears

Error adding geofences in Android (status code 1000)

╄→гoц情女王★ 提交于 2019-11-26 16:48:56
问题 I am getting an error in the onAddGeofencesResult(int statusCode, String[] geofenceRequestIds) callback with statusCode = 1000 . I have my GPS enabled and my WiFi. I also have Google Play Services and I am able to track my location and request updates. Why am I not able to add geofences? I am not able to add geofences even from the documentation sample app. I get the following Toast message: "Add Geofences: Failure, error code 1000 GeofenceRequestIds=[1,2,1,2]" From the documentation

Android play services 6.5: LocationClient is missing

我与影子孤独终老i 提交于 2019-11-26 06:39:18
问题 After updating to Google Play Services 6.5.87 my app was failed to compile because of missing LocationCLient class. The documentation link is corrupted at the moment (404 Not Found) How can I fix it? I want to receive location updates, work with geofences, etc.. 回答1: The LocationClient class has been replaced with the new FusedLocationProviderApi and the GeofencingApi, both of which use the common GoogleApiClient connection technique to connect to Google Play Services. Once you are connected,