M mauro vicamini Active Member Licensed User Longtime User Nov 28, 2016 #1 Hi Everyone, maybe it's a stupid question: is it possible to use KeepAlive and PartialLock inside a service? Or is it possible to use them only in activities? Thanks a lot
Hi Everyone, maybe it's a stupid question: is it possible to use KeepAlive and PartialLock inside a service? Or is it possible to use them only in activities? Thanks a lot
ilan Expert Licensed User Longtime User Nov 28, 2016 #2 Keep alive will just prevent your phone from sleeping mode so it is ment for activities. You can keep a service always in forground or use a sticky service if u dont want android to kill your service. What exactly do you want to archive? Upvote 0
Keep alive will just prevent your phone from sleeping mode so it is ment for activities. You can keep a service always in forground or use a sticky service if u dont want android to kill your service. What exactly do you want to archive?
M mauro vicamini Active Member Licensed User Longtime User Nov 28, 2016 #3 I'd like to keep alive a service in background of mobile phone that listen for request to send SMS. The problem is that the mobile goes after some time in stand by and don't recive the request to send SMS. Maybe is it better to use a PartialLock intsead of a keepalive? Upvote 0
I'd like to keep alive a service in background of mobile phone that listen for request to send SMS. The problem is that the mobile goes after some time in stand by and don't recive the request to send SMS. Maybe is it better to use a PartialLock intsead of a keepalive?
ilan Expert Licensed User Longtime User Nov 28, 2016 #4 You want to check if the phone is sending an sms with a service and when the phone send the sms u want to do something? Upvote 0
You want to check if the phone is sending an sms with a service and when the phone send the sms u want to do something?
ilan Expert Licensed User Longtime User Nov 28, 2016 #5 If yes than you dont need to have a service in forground or a sticky service you can listen to sms_receive or send intent and like this perform what ever u want when the phone send/receive a sms. Have a look at this: https://www.b4x.com/android/forum/t...sms-messages-in-the-background.20103/#content Upvote 0
If yes than you dont need to have a service in forground or a sticky service you can listen to sms_receive or send intent and like this perform what ever u want when the phone send/receive a sms. Have a look at this: https://www.b4x.com/android/forum/t...sms-messages-in-the-background.20103/#content
M mauro vicamini Active Member Licensed User Longtime User Nov 28, 2016 #6 No, the service have a socket open to recive requests from a pc to send SMS. I'd like to prevent the mobile to go in stand by, so the service could continue to listen for requests to send SMS. Upvote 0
No, the service have a socket open to recive requests from a pc to send SMS. I'd like to prevent the mobile to go in stand by, so the service could continue to listen for requests to send SMS.
ilan Expert Licensed User Longtime User Nov 28, 2016 #7 if the mobile goes to standby the service should still work only if you kill the app or android does then the service will be killed to. but you can use a sticky service to keep it alive or use "Service.StartForeground" have a look at this: https://www.b4x.com/android/forum/t...-long-running-background-tasks.27065/#content Upvote 0
if the mobile goes to standby the service should still work only if you kill the app or android does then the service will be killed to. but you can use a sticky service to keep it alive or use "Service.StartForeground" have a look at this: https://www.b4x.com/android/forum/t...-long-running-background-tasks.27065/#content