android-geofence

Geofence Android isn't working (IntentService isn't called)

╄→尐↘猪︶ㄣ 提交于 2019-12-06 12:30:47
Here are my code : Android Manifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="pounya.id.location3"> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> <service android:name=

Geofence events not always called

与世无争的帅哥 提交于 2019-12-06 11:53:36
问题 This is how I add my geofences: public void setGeofenceRequest(Location location) { if (geofences == null) { geofences = new ArrayList<Geofence>(); } geofences.add(new Geofence.Builder() .setRequestId("3") .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_EXIT) .setCircularRegion( location.getLatitude(), location.getLongitude(), PSLocationService.getInstance(context).kPSGeofencingDistanceMedium) .setExpirationDuration(Geofence.NEVER_EXPIRE) .build()); Intent intent = new Intent(context,

Android Google Geofencing transition jumps even device is not moving

a 夏天 提交于 2019-12-06 11:26:05
问题 I have developed a Geofencing App, which is working mostly proper. But I have also users saying me, that the app is reporting repeatable entering and exiting of the zone even the device is not moving! The app uses the latest Google Geofencing API with the transition types GEOFENCE_TRANSITION_ENTER and GEOFENCE_TRANSITION_EXIT with expiration NEVER_EXPIRE and ACCESS_FINE_LOCATION on. The users configured also a large radius with 2000 meters with no success. The locations are set to high

not able to get alert in geofencing

柔情痞子 提交于 2019-12-06 07:32:03
问题 I have run a sample of Geofence and I have assigned two set of Lat , Lng and radius and run the sample. When I tap over register geofence I am getting following things in my log Location Services is available Client connected Add Geofences: Success GeofenceRequestIds=[1, 2] com.example.android.geofence.ACTION_GEOFENCES_ADDED but nothing happens after that, I don't know what the issue I am passed the current location by enabling gps but no effect. I don't know when I am gonna get the

Geofence - problem in triggering 'GEOFENCE_NOT_AVAILABLE'

▼魔方 西西 提交于 2019-12-06 05:05:32
I do app with geofencing use and since I started to work with it I get to broadcastReceiver the transitions and when I turned off the GPS location I got an alert with code GEOFENCE_NOT_AVAILABLE and I started a service to reregister the geofences when I will turn on the GPS. Now I took a few days break and suddenly my broadcastReceiver doesn't get alerts when I turn off the GPS. I don't understand why? *when I enter/exit from location (like I defined in the geofences init) I trigger the alerts, the problem is just at the triggering of the GEOFENCE_NOT_AVAILABLE alert. I will glad if anyone can

Android geofencing when app is killed

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 04:39:09
问题 My main requirement would be to have a service having its own process and trigger its own geofencing event. I'd like the user to be notified from the notification center when he enters a geofence, even if the app is killed. I read about services and this seems pretty clear to me, the Android documentation is dense so I managed to understand how to start a service with its own process, and also how it is able to communicate with the app using Messenger. Then there is this code sample from

Android Geofencing - No coming intents?

我怕爱的太早我们不能终老 提交于 2019-12-05 23:01:20
问题 I have a strange problem. I implemented geofencing using Google Services. (Implementation below) On my devices (Samsung Galaxy S and Moto X) they work perfect. On some other devices (HTC Incredible S, Galaxy Note), I receive no transition intents. Never. With great, accurate GPS fix, standing in the middle of fence. Nothing. Nothing suspicious in logs. No errors, no warnings. No itents come, the service does not start. Have anyone ever seen such a thing? (It is weird because I can't see any

Do Android Geofences remain active until removed/expired or only until my PendingIntent is launched

孤街浪徒 提交于 2019-12-05 04:02:21
I'm about to implement a feature with geofences and before I get any serious work done, I need to know whether geofences remain active after the first transition. The core of the feature is: every time I'm within x meters of point P (call this Area A ), I want Action B to occur. What I need to know is Do I just have to add a geofence with Geofence.NEVER_EXPIRE and rest assured that I will get a PendingIntent every time I enter the specified area regardless of elapsed time, reboots, etc OR Do I have to re-register this geofence once I exit Area A in order to get notified the next time I enter

Geofence events not always called

*爱你&永不变心* 提交于 2019-12-04 17:17:53
This is how I add my geofences: public void setGeofenceRequest(Location location) { if (geofences == null) { geofences = new ArrayList<Geofence>(); } geofences.add(new Geofence.Builder() .setRequestId("3") .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_EXIT) .setCircularRegion( location.getLatitude(), location.getLongitude(), PSLocationService.getInstance(context).kPSGeofencingDistanceMedium) .setExpirationDuration(Geofence.NEVER_EXPIRE) .build()); Intent intent = new Intent(context, ReceiveTransitionsBroadcastReceiver.class); PendingIntent pi = PendingIntent.getBroadcast(context, 0, intent,

Issue Moving from IntentService to JobIntentService for Android O

荒凉一梦 提交于 2019-12-04 12:44:28
I am using Intent Service to monitor Geofence transition. For that I am using following call from a Sticky Service. LocationServices.GeofencingApi.addGeofences( mGoogleApiClient, getGeofencingRequest(), getGeofencePendingIntent() ) and the Pending Intent calls Transition service (an IntentService) like below. private PendingIntent getGeofencePendingIntent() { Intent intent = new Intent(this, GeofenceTransitionsIntentService.class); // We use FLAG_UPDATE_CURRENT so that we get the //same pending intent back when calling addgeoFences() return PendingIntent.getService(this, 0, intent,