Android Question Cpu Sleeping lock

josnav

Member
Licensed User
Longtime User
Hi to all:
I have tested the example:
All is ok, but when device goes to blank screen, notifications doesn't arrive. Solved with Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_NEVER.
Now when device is going to sleep (10-15 minutes) notifications doesn't arrive again. I think service is destroyed or paused, so how can I solve it?

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
Are you killing the App from the Taskmanager? Or have an app which does that?
 
Upvote 0

wes58

Active Member
Licensed User
Longtime User
Hi to all:
...I think service is destroyed or paused...?

Thanks
You know that you can see on your phone if the service is running (you can see all running services) if you have "Developer Options" enabled in the phone Settings?
 

Attachments

  • Settings.jpg
    Settings.jpg
    86.6 KB · Views: 139
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Solved with Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_NEVER.
This won't solve anything.

Carefully follow the tutorial. You don't need to add anything not mentioned in the tutorial.

You know that you can see on your phone if the service is running (you can see all running services) if you have "Developer Options" enabled in the phone Settings?
The service doesn't need to run. This is not how push messages work.
 
Upvote 0

josnav

Member
Licensed User
Longtime User
This won't solve anything.

Carefully follow the tutorial. You don't need to add anything not mentioned in the tutorial.


The service doesn't need to run. This is not how push messages work.

Sorry but followed tutorial STEP BY STEP but 5-10 minutes after I push power button, no notifications arrive. When I push power button and device wake up, then notifications arrive again.
I need to ensure that notifications arrive even device goes to sleep.
Any help? (Followed tutorial meticulously)

Thanks
 
Upvote 0
Top