Android Question Problem using start at boot with Android 10

Sergio83

Active Member
Licensed User
Longtime User
Hello all,
A few years ago, I developed a home automation server with many features, including Alexa.
It is supported by an Android TV box that I just upgraded from Android 8 to 10.
This application has a service with the start at boot option.
I know that version 10 supports this option, but the launched application does not go to foreground.
Is there a workaround?
I looked at the Erel application "MyLocation", without finding the solution to my problem.
Thank you in advance for your help
 

Sagenut

Expert
Licensed User
Longtime User
First step is to remove this from the starter service: #StartAtBoot: True

The starter service should never be started at boot.
Did the change, but no luck.
Still not starting after reboot.
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
Activity not showing and it looks that a Log in the receiver never get raised.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Last post of me in this thread as I wasted too much time on this.

You should write:
B4X:
AddReceiverText(SOB,
<intent-filter>
    <action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>)

Instead of:
B4X:
AddReceiverText(SOB,
<intent-filter>
    action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>)

Tutorial here: https://www.b4x.com/android/forum/threads/receivers-and-services-in-2023.145370/#content
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
Last post of me in this thread as I wasted too much time on this.

You should write:
B4X:
AddReceiverText(SOB,
<intent-filter>
    <action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>)

Instead of:
B4X:
AddReceiverText(SOB,
<intent-filter>
    action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>)

Tutorial here: https://www.b4x.com/android/forum/threads/receivers-and-services-in-2023.145370/#content
I can confirm that now it work.
Thanks for pointing me to the problem.
I am sorry that I didn't noticed that I mispelled one character on a line, and not making a complete wrong code.
Probably I deleted it by accident on subsequent check of the Manifest.
Anyway I will not waste the time of the others anymore in the future.
 
Upvote 0

Sergio83

Active Member
Licensed User
Longtime User
I know that and I agree with you Erel but I tried to run Sagenut's example as is.
I think I have manage as you suggested me, see post #5 and post #14. But I got a poor result. Is there something wrong in my code?

Edit: I don't know why but I got your reply and Sagenut one just after sending this post.

So it seems I got now the solution, I've just to implement it.
I apologize for this posts collision.
 
Last edited:
Upvote 0

rosippc64a

Active Member
Licensed User
Longtime User
Hi!
just for information: this project didn't work for me on LineageOS 22.1 (raspberry PI), but somewhere I read and that was the solution (into the manifest):
B4X:
SetReceiverAttribute(SOB, "android:exported", true)
 
Upvote 0
Top