Android Question services: strange messages

Roberto P.

Well-Known Member
Licensed User
Longtime User
I still have problems with the operation of the services, which do not always start at the established intervals.

I set the start every 5 minutes

B4X:
    StartServiceAt("", DateTime.Now + 5 * DateTime.TicksPerMinute, True)

these messages are displayed occasionally:

No partial wakelock.
** Service (starter) Destroy (ignored)**
** Receiver (starter) OnReceive **
The Starter service should never be started from a receiver.
*** Service (starter) Create ***

someone can help me understand what it can be

thank in advance
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Roberto P.

Well-Known Member
Licensed User
Longtime User
thank Manfred

I read the post about services in Android 8, and At this point I ask for help to correctly create a service that remains always active, which starts every 5 minutes or less, which works from version 6 of Android up to 8.01.

thank in advance
 
Upvote 0

Roberto P.

Well-Known Member
Licensed User
Longtime User
You shouldn't use StartServiceAt with the starter service. Use a different service.

Always running service that works on all versions of Android: Background location tracking


Hi Erel,
this is the implementation:

- I've Starter Service
- I've Sync Service

- StartService run Sync service:

B4X:
Sub Service_Start (StartingIntent As Intent)
....
StartService(SSync)


- SyncService have the startAt timer

B4X:
Sub Service_Start (StartingIntent As Intent)
...
StartServiceAt("", DateTime.Now + 5 * DateTime.TicksPerMinute, True)

' this is try for not terminate the service
Service.AutomaticForegroundMode =  Service.AUTOMATIC_FOREGROUND_ALWAYS

there is somethings wrong?

thank
 
Upvote 0

Roberto P.

Well-Known Member
Licensed User
Longtime User
Based on the warning message you are starting the starter service from a receiver. This is a mistake. It doesn't happen in the code you posted.

so what can be caused by an error?

Yes, newer versions of Android will not let you schedule the app to start every 5 minutes.

what is the minimum time?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Last edited:
Upvote 0
Top