geofencing

Tracking more than 100 simultaneous geofences with the new Android API

陌路散爱 提交于 2019-11-29 04:12:20
问题 I have around 3500 geographical points of interest in an area of 9000 km^2, and I want my app to run in the background and notify the user whenever he or she is in proximity to any of the aforementioned points. The new Geofence API introduced during Google I/O 2013 seemed perfect for the job, especially as its optimized for battery life, but I can't seem to register more than 100 geofences before I get the status code GEOFENCE_TOO_MANY_GEOFENCES (using a modified version of the demo app). Is

Number of “region” monitored by RegionMonitoring, based on users current location in iOS7

耗尽温柔 提交于 2019-11-29 02:29:34
I am working on such a project where apps do the following things: User select a radius (10 meter to 1000 meter) and go to next viewController by pressing "Go" button Here apps Grab users current position and start "region monitoring" based on that current position with selected radius If the user cross that certain boundary (10 meter to 1000 meter) then it gives an "ExitRegion" alert message. And start "region monitoring" again based on users new current position. And the apps keep doing this all the time, both foreground and background mode. I manage to do it & it is working perfectly. Now,

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

How to check for Mock Location in Android Marshmallow?

时光总嘲笑我的痴心妄想 提交于 2019-11-28 23:49:28
How to detect if the location is triggered with Mock Location in Android Marshmallow ? Previously, I used Settings.Secure.ALLOW_MOCK_LOCATION But, in API level 23, this has been deprecated. I want to check if the trigger is with Fake location or original GPS ? Now, what is the alternative to check if Mock Location is enabled or not Android Marshmallow ? If you are using FusedLocationProviderApi and have set mock location using setMockLocation(mGoogleApiClient, fakeLocation); in the callback/pendingIntentCallback the returned Location object contains KEY_MOCK_LOCATION extra, a boolean that

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 - 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

Android Geofencing (Polygon)

ⅰ亾dé卋堺 提交于 2019-11-27 20:16:53
How to create Polygon Geofence from multiple geo locations(long,lat values) . Also how to track user is entering into this geofence region or exiting from this region on android. matthewrdev A geofence is simply an array of lat/long points that form a polygon. Once you have a list of lat/long points, you can use a point-inside-polygon check to see if a location is within the polygon. This is code I have used in my own projects to perform point-in-polygon checks for very large concave polygons (20K+ vertices): public class PolygonTest { class LatLng { double Latitude; double Longitude; LatLng