blunden / XBMCLauncher

A helper app to allow setting XBMC as your Launcher in Android
Apache License 2.0
35 stars 18 forks source link

Autostart other services #7

Open jthomeo opened 9 years ago

jthomeo commented 9 years ago

Hi. I have XBMC installed on my Minix device.

After I've installed XBMC Launcher, other apps stopped launching automatically, like my SSH, FTP and VNC services.

It would be very nice if we could mark other apps to autostart with XBMC.

blunden commented 9 years ago

Interesting. I would expect those apps would wait for "boot complete" and that that would be sent by the system. Can you link me to any of those apps so that I can see what they are waiting for?

This might be related to another issue I got sent via email.

blunden commented 9 years ago

They should receive android.intent.action.BOOT_COMPLETED from the system as far as I can see, assuming they are listening for that intent. I'll have to investigate more but a copy of one of the apps like I mentioned above would be helpful.

jthomeo commented 9 years ago

I'm using "Servers Ultimate" for VNC and FTP, and "SSHDroid" for SSH remote access. If this apps starts on the boot using XBMC Launcher, it would be perfect.

As a workaround, I'm using Startup Manager on another launcher, and there I tell it to start XBMC. This works, but I have the launcher screen before xbmc.

jlddodger commented 8 years ago

I am running into this as well. It prevents my Ouya from starting Bluetooth which disables the controller. Could it be related to this?

http://stackoverflow.com/questions/25887630/android-custom-launcher-startactivity-blocks-boot-completed-intent

Maybe the launcher needs to wait until Boot_Completed is received before calling startActivity. I didn't look at the code so this may be way off.

blunden commented 8 years ago

@jlddodger Yes, that is most likely related. I have had a few tabs with related information opened in my browser for quite a while now but I never got around to to checking them again after looking at it a few times initially. Your link is seemingly slightly more useful though, thanks. I'm guessing I will need to create a splash screen activity or something that is displayed until everything is ready. I can't just wait or sleep on the UI thread for obvious reasons.

http://stackoverflow.com/questions/5051687/broadcastreceiver-not-receiving-boot-completed http://stackoverflow.com/questions/17226410/android-boot-completed-not-received-when-application-is-closed http://stackoverflow.com/questions/11741694/android-intent-action-boot-completed-doesnt-get-fired-on-boot

blunden commented 8 years ago

Simply changing the app to wait to launch Kodi until BOOT_COMPLETED is received resulted in at least a 15-30 second delay in starting it up, requires a permission that launchers shouldn't need and doesn't result a particularly great UX. Clearly there are better ways to solve this but I don't know what. Needs further research but it wouldn't hurt if Google documented this behaviour better.

blunden commented 8 years ago

Actually I think I just solved this particular problem without doing the above mentioned changes. At the very least, I now see BOOT_COMPLETED being broadcast.

blunden commented 8 years ago

@jthomeo @jlddodger Please try if version 2.4 that I just pushed to the Play Store fixes the issue for you.

pakerou commented 8 years ago

Hello Blunden,

Thanks for your update but not working some app and service not started after kodi

I think you need this method with BroadcastReceiver? http://stackoverflow.com/questions/34081572/android-start-activity-on-boot-complete

jlddodger commented 8 years ago

Yeah, I tried it several times. Bluetooth did not enable once Kodi was started.