0

I made an android app for geofencing.

It works well, since I moved all the location sensor and the activity search to the service associated with the app which I also put in the foreground.

I took a few walks, and the notification always clicked, when, even with the phone off, I entered a delimited perimeter using an administration program that I always wrote.

I just had this doubt:

with the service always running and, therefore, with the tlocationsensor always active, the user always finds the relative icon displayed at the top which indicates that, in fact, the geolocation is running.

I thought this might annoy the user a lot.

at least to me, it would be a great annoyance to always see that active geolocation icon, always displayed.

I had then thought, still in the service, to have the geolocation activated only when the user turns on the phone. let it do the relevant search, trigger the notification if it finds something, and then deactivate it immediately.

at least, google maps, it seemed to me that it does just that. Precisely in order not to always keep the geolocation activated and, therefore, the relative icon at the top always visible.

in this way, when a user takes the phone out of his pocket and turns it on, if, at that moment, he is inside a delimited perimeter, the notification is immediately triggered.

However, I don't know, from the service, how to intercept the event for which the phone is turned on.

By on, I'm obviously referring to when the user unlocks it.

Could you tell me how to do to intercept the aforementioned event?

mmh4all
  • 1,612
  • 4
  • 6
  • 21
Valerio
  • 49
  • 4

0 Answers0