android-geofence

How to add background service in Geofence android

心已入冬 提交于 2021-02-06 08:51:50
问题 I am trying to create a geofence with background service for monitor. The geofence create successfully and work when apps Activity is open but when close the app geofence not work. What should I do now. My code is: public class MapsActivity extends FragmentActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Android 11 users can’t grant background location permission?

爷,独闯天下 提交于 2021-01-20 16:44:29
问题 As of Android 11, apps targeting SDK 30+ will not show a user an option to grant background location permission to an app, instead it requires users to go to a settings page. How do we bring a user to the proper settings page? When a feature in your app requests background location on a device that runs Android 11 or higher, the system dialog doesn't include a button to enable background location access. In order to enable background location access, users must set the Allow all the time

Android 11 users can’t grant background location permission?

浪子不回头ぞ 提交于 2021-01-20 16:43:06
问题 As of Android 11, apps targeting SDK 30+ will not show a user an option to grant background location permission to an app, instead it requires users to go to a settings page. How do we bring a user to the proper settings page? When a feature in your app requests background location on a device that runs Android 11 or higher, the system dialog doesn't include a button to enable background location access. In order to enable background location access, users must set the Allow all the time

Android geofence BroadcastReceiver

我怕爱的太早我们不能终老 提交于 2020-06-12 05:49:06
问题 I have implemented geofences using the GoogleApiClient -> when triggered, a Service connects to the GoogleApiClient and adds several Geofences. Before I had another IntentService registered as "callback" for geofence events. This worked more or less, but only when the app was in foreground. As I want to get geofence events also when the app is in background/closed, I searched a little and moved the callback from an IntentService to a BroadcastReceiver, now I don't even get geofence events

IntentService stops working when app is removed from recent apps

南楼画角 提交于 2020-01-14 06:49:29
问题 I am using geofence in my app and based on geofence events (Enter or Exit) I want to perform some action. Geofence documentation says that once you set geofence it will trigger events automatically and you can catch this events with IntentService. For that I have made intentservice as below: GeofenceTransitionsIntentService.java public class GeofenceTransitionsIntentService extends IntentService { Handler mHandler; public GeofenceTransitionsIntentService() { super(

New Android Geofence Api - Sample code does not alert/notify when at location

こ雲淡風輕ζ 提交于 2020-01-12 03:51:32
问题 I need some clarity on the sample code supplied with Geofence guide as posted here : https://developer.android.com/training/location/geofencing.html I ran the code and I see that geofences are created correctly, but what I really want is a way to get alerted when I drive to those geofenced locations. Right now, when I go past those geofenced spots, nothing happens (ReceiveTransitionsIntentService does not get called), no notifications nothing. Do I also have to listen to periodic location

addProximityAlert doesn't work as expected

北慕城南 提交于 2020-01-01 06:42:06
问题 ios sdk has great region monitoring functions. I need something like that in android and i think we have two alternatives. Geofencing and LocationManager. Geofencing has really tidy examples and bugs , so i prefered LocationManager. Everyting works fine in LocationManager except one. If you add your current location as ProximityAlert , it immediatly fires "ENTERING" , but it is my current location , it doesnt mean that i entered this region. Because of that , it fires "ENTERING" each time i

After geofence transition how do i do something on main Activity?

青春壹個敷衍的年華 提交于 2020-01-01 06:40:07
问题 When someone enters one of my geofences I want to make a layout visible over my map and start playing some audio. I have been following some tutorials and I know how to do push notifications when they enter, but this all happens in another IntentService class. Maybe this is what onResult is for? Im not sure how to get geofence info from the result parameter LocationServices.GeofencingApi.addGeofences( gApiClient, getGeofencingRequest(), getGeofencePendingIntent() ).setResultCallback(this);

GeoFence Device when app is in background

允我心安 提交于 2019-12-31 22:37:08
问题 I have implemented the geoFence api and everything is working good. But there are some problems, I want more clarification regarding my confusions. Here are some of the confusions and problems: I want my user to get notified when he enters a geofenced area. I have implemented the GeofenceTransitionsIntentService as per guideline but it is not triggering the transition when the app is in background. What should I need to do? GeoFence Expire time: it is pretty obvious that if we enter Never it