Android Question App always running (for get location gps)

netsistemas

Active Member
Licensed User
Longtime User
We are trying to make an application that is always running.

We can send messages through FIREBASE, but I think they don't arrive if the user kills the application.

It seems to me that the user has control, and not the programmer, so this objective is impossible.

All part of the idea of locating the devices.

Also, we have another application, which could execute the geolocation one, but the same thing happens to us, what's more, even if it is not closed, and only minimized, I think the Geolocation application cannot be executed.

They tell me about Java/Android JOBs, but in B4X I don't know if they exist, it's a bit like startat . I see that there are many messages in the forum, but perhaps they are old and each time,

Android restrictions cut this objective more
------------
 

josejad

Expert
Licensed User
Longtime User
Have you tried this example?

 
Upvote 0

netsistemas

Active Member
Licensed User
Longtime User
Yes, and is ok, but if the user CLOSE de app. (applications -> Close)
How re-start de app. that is the target...
i can install other apps, use firebase , etc..

any aditional idea?

the user have ALWAYS de control !!!! (no the development)
That is true?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
That is true?
Yes. It is the device of the user and HE control which app have which Permissions.
Some Devices are more trestricting than other devices do too.

I do regularly restrict ALL App which uses GPS. I see no need for them to know my Position usually.
 
Upvote 0

netsistemas

Active Member
Licensed User
Longtime User
Understand. A client wants to geolocate his employees. They know it and admit it, but we believe that some, when they are interested, 'kill' the application. I'm afraid that this has no solution, no matter how many techniques and turns we give it. Thank you Don Manfred and Aguilar
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
A client wants to geolocate his employees
If the Employees are using a Company-Device then you can use Kioskmode and restrict the user from using other apps.
And probably you can get GPS Permission here easier too (i don´t know).
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
I don't know if there some event triggered when the app is killed, maybe you could register that events, so you can have in your db something like:
event_01: location tracking started
event_02: location adquired at 14:03:22
event_03: location updated at 14:16:54
event_04: app killed by the user at 18:23:11
 
Upvote 0

netsistemas

Active Member
Licensed User
Longtime User
if the user closes the APP the startserviceat processes die and are not launched.

On the other hand, I thought I read that in android 13, startserviceat cannot be executed, although I think I misunderstood it, because it still works for me.
I also read something that tasks (JobScheduler) are not implemented in b4x or similar to startserviceat
The truth is that there is a lot of documentation with different messages. I suppose that each version of Android has its peculiarity, and the more it advances, the more developers are prevented from doing 'strange' things.

AgulIar: the crash control is posibble, but close by user (in applications of S.O.), i think is unsuppoorted.
 
Upvote 0
Top