I am new to Android programming, and I am working on an application that will provide an interface to the device. The Android device on which the application will run will be connected to the device and will only be used to control the device. The application I'm working on will be the only application that ever runs on a dedicated Android device.
One of the requested features is to automatically launch the application when the Android device starts. I implemented this function by detecting the intention ACTION_BOOT_COMPLETED, as described in this thread . However, I saw an alternative approach recommended to make the application a home screen, as described in this topic .
I understand that implementing the autostart function by detecting ACTION_BOOT_COMPLETED, as I have already done, may not be the best approach for Android applications in general. But, as already mentioned, in my case, the application that I am developing will be the only application that has ever been used on a device. Given that the approach that I take is reasonable? Or is there a better way to implement autostart?
Please note that one of the considerations is the ease of setting up your Android device. The approach I'm taking will require one manual step to launch the application for the first time. But it seems like a manual step will also be required if I take an alternative approach to creating an application on the home screen, so there will be no advantage in adopting such an approach in this regard.
Thank you for your help!
EDIT: I tried to configure the application as the main screen by changing AndroidManifest.xml, as Holmes suggested below. Here is what I have found so far in my comparison of the two approaches: (1) The code is much simpler using the home screen approach, which requires only minor AndroidManifest.xml settings, and not more significant changes and an additional BroadcastReceiver class, (2) Installation procedure a bit more complicated using the approach to the home screen, since you need to do more than just open the application, but not significantly more complicated. (3) The approach to the home screen is better for restricting the user to one application, since he cannot use the default home screen to launch other applications. Based on these results, I will probably use the approach to the home screen.
source share