Android Question Three Questions about receivers

hatzisn

Well-Known Member
Licensed User
Longtime User
Good morning to all of you,

I have three questions for receivers. For starters I would like to explain the situation. The receiver starts and intializes an object (class) that takes care of anything of the things that I explain immediately. The first think it does is that it initializes a Fused Location Provider and initiates the hearing of location events. When it gets it it posts the location on a webserver.
The app has in the manifest the following:

AddPermission(android.permission.ACCESS_COARSE_LOCATION)
AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddPermission(android.permission.ACCESS_BACKGROUND_LOCATION)

The RuntimePermissions that have been given is "locate always".
When the app is in foreground the receiver runs correctly and the "located" event is executed but when the app is not in the foreground the receiver runs but the "located" event is not executed. Why is this happening?

Also I would like to know this. When I used to start a service from the running in foreground app I used to call PhoneWakeState.PartialLock. When the receiver starts does it have internet access? If I call partial lock in the starting of the receiver does it keep it until it stops running in order to be able to connect to the internet?

Edit - I checked and it has internet access even in background

At last when the app is in the background the receiver starts (even with closed screen) but when the app is closed the receiver does not start. Why is this?
 
Last edited:

Computersmith64

Well-Known Member
Licensed User
Longtime User
At last when the app is in the background the receiver starts (even with closed screen) but when the app is closed the receiver does not start. Why is this?

What broadcast action is the receiver expecting?

- Colin.
 
Upvote 0
Top