Android Question Service/App not starting on boot

David Janse van Rensburg

Member
Licensed User
Hi guys

I am having a strange problem where a service/app I have built doesn't start on boot on a specific tablet/ set of tablets but does fine without an issue on the others.

Here are the specs of the tablet that it is not working on:

Model: Lenovo TB-X304L
Android version: 7.1.1
Android security patch level: July 1, 2018
Kernel version: 3.18.31
Hardware version: Lenovo Tablet TB-X304L

I have created a "shell" app (which is attached) that just writes a log when it starts up for testing and to help with diagnosing the problem. It is set to start up the same way the main project is ("#StartAtBoot: True"). Starts up fine on a Samsung phone or tablet with the same version of android on it.

Because it is a service and not a GUI and compiled with sdk 26 it doesn't ask for permissions on installation or when you open it. Will need to give it read/write permissions manually in the app settings.

Your help will be appreciated.

Thanks
Dave
 

Attachments

  • Servicetest.zip
    8.7 KB · Views: 201

Brian Dean

Well-Known Member
Licensed User
Longtime User
... doesn't start on boot on a specific tablet/ set of tablets

I had a similar problem once with HTC 'phones, and then I discovered that HTC had replaced the default OnBoot event with a version of their own so that they could implement a "fast-boot" feature.

Possibly Lenovo have done something like that. There is a report (and a solution) of a problem like the one that you describe here ...

https://forums.lenovo.com/t5/Lenovo...ent-on-TB2-X30L-Alternative-name/td-p/3296391

Hope this helps.
 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
Thanks Brian, how do you make it a system app?

Sorry - I don't know. In the HTC case I discovered that HTC had created their own broadcast intent (if that is the correct term) that was issued at the end of the "fast-boot" sequence.
 
Upvote 0

David Janse van Rensburg

Member
Licensed User
Sorry - I don't know. In the HTC case I discovered that HTC had created their own broadcast intent (if that is the correct term) that was issued at the end of the "fast-boot" sequence.
Thanks Brian, had a look through the options for installing an app as a system app and all involved rooting which didn't seem so safe.

@Erel, I was wondering is it possible to start the app using a push notification to bypass this issue?
 
Upvote 0

Louis Moskowitz

Member
Licensed User
Longtime User
Push notification will start the app. You can send a notification every hour or so to start the app. It is quite simple with Firebase.
Hi Erel

I have implemented the push notification and it still does not start the App on the Lenovo Tablet. If the App is running in the background, I receive the notification.
I also included some data with the notification as there have been some articles suggesting that a payload is required for the app to be started.
Used the B4J sample code to send the notifications, by the way.

Any ideas?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
If the App is running in the background, I receive the notification.
This means that the app was started. It is your code that shows the notification (assuming that you are using the B4J tool to send the messages).
You can call StartActivity(Main) from the MessageReceived sub to show an activity.

I also included some data with the notification as there have been some articles suggesting that a payload is required for the app to be started.
Not needed.
 
Upvote 0
Top