android-geofence

Monitoring Location Settings in a Library

一曲冷凌霜 提交于 2019-11-29 04:09:46
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 providers in my test application. I don't receive it at all when toggling Location Services in the

Handling multiple geofences transition with common area

为君一笑 提交于 2019-11-29 02:24:06
问题 If I have these two geofences, after registering these geofences I should get notified when I'm entering or exiting the circumference of these circles. However, I don't want my App to send a notification if I'm moving through the common area, i.e. from once circle to another. Is it possible? If so, then how? 回答1: You will have to use a class for monitoring your fencing: public class GeofenceReceiver extends BroadcastReceiver { Context context; Intent broadcastIntent = new Intent(); @Override

Are Android geofences surviving a reboot?

浪子不回头ぞ 提交于 2019-11-29 01:39:53
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 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 android:installLocation="internalOnly" in the manifest tag . This is because, android device will broadcast

Android LocationServices.GeofencingApi example usage

南楼画角 提交于 2019-11-28 20:33:43
问题 Does anyone know of an example of using the LocationServices.GeofencingApi? All the android geofencing examples I find are using the deprecated LocationClient class. From what I can see, the LocationServices class is the one to use, but there doesn't seem to be any working examples on how to use it. The closest I've found is this post highlighting location update requests UPDATE: The closest answer I've found is this git example project - but it still uses the deprecated LocationClient to get

Android Geofence only works with opened app

家住魔仙堡 提交于 2019-11-28 19:01:35
I'm doing a serious research on this topic for many days... I saw many topics here too... But unfortunately I couldn't find a solution.... I'm writing an app that uses the new Google API for Geofence... Well, I can handle "ins" and "outs" of a geofence, but only if my app is open! Even if I'm with wifi on, gps on, and 3G on, but the app, it does not trigger any event...Just if the app is open... I'm using exactly the same GeofenceRequester class of the documentation http://developer.android.com/training/location/geofencing.html . Even the class been the same I'll post the code here: package br

Couldn't connect to Google API client

青春壹個敷衍的年華 提交于 2019-11-28 13:32:43
I can't fetch last known location. I have enabled Geocoding API and Google Places API for Android in google console. I added api key to manifest file: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> <meta-data android:name="com.google.android.geo.API_KEY" android:value="@string/google_api_key" /> but I keep getting a message in the console: " Couldn't connect to Google API client: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null} " UPDATE I use google sample protected synchronized void buildGoogleApiClient() {

Android - Need to add more than 100 geofences

梦想与她 提交于 2019-11-28 06:39:18
I'm developing an application where user can set multiple locations. I get succeed to show notifications when user get Enter or Leave specific region using GeoFencing . Now, there is situation that i need to provide monitoring for all saved locations and it can be hundreds and more. I've read at the given link "You can have multiple active geofences, with a limit of 100 per device user." Is there any way add more then 100 geofences per device user ? Thanks! Have an ArrayList with all the geofences you want to monitor +100. Listen to location updates. When you get a location update, if the

How to make Geo Fencing alert more accurate in Android

耗尽温柔 提交于 2019-11-28 05:34:19
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 perfectly without any issue. public class MainActivity extends Activity implements GooglePlayServicesClient

Android: Build Polygonal Shape Geofence

喜欢而已 提交于 2019-11-28 00:11:50
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, because I think this kind of services are CPU & power consuming... Thanks, You have to do it by

How do I use the Android Geofencing API?

£可爱£侵袭症+ 提交于 2019-11-27 19:06:46
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 LocationClient class documentation , and found the following paragraph: In case network location provider is