Is there a way to make my app the only running app in a device, what I mean is the only visible and open app? Once the device booted, the app will launch automatically while any tap to settings at status bar, back, home and recent apps button are disabled. Probably a custom Android OS is required or rooting the device will be enough? We plan to have a set of devices where users can only operate with one app. Thanks
1 Answer
You need to be able to remove current launcher app to the system part of the device.
Then it's as simple as:
- Adding
android:launchMode="singleTask"to activity tag inAndroidManifest.xml - Adding
<category android:name="android.intent.category.DEFAULT" />and<category android:name="android.intent.category.HOME" />to your intent filter
The end result should look similar to this:
<application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.example.app.MainActivity" android:launchMode="singleTask" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.HOME" /> </intent-filter> </activity> </application> 9 Comments
Bitwise DEVS
yes but how about when user taps home button or open other apps?
Lukáš Anda
If you don't have any other android app installed, the device will use this one. And if the user taps on home button, it won't be exited I believe. Give it a go and you'll see :)
Bitwise DEVS
But you can still uninstall it
Lukáš Anda
Not if you make it a system app and prevent user from doing so. Basically the same way you can replace default Android launcher app, somebody can do the same to your launcher app.
Bitwise DEVS
But user can still navigate around aside from my app right?
|