Do you want to develop an app that automatically launch on android startup? If yes, then your lucky because it is very easy to do on android. To make your app auto launch on startup, first you must put the bellow code on your AndroidManifest.xml under your main activity.
android:launchMode="singleTask"
After placing that code, put the bellow code on the intent filter of the same main activity.
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.HOME" />
That’s it!, it’s very simple line of code to make an android launcher or make your app auto launch on startup of the device.
For additional information, your codes in AndroidManifest.xml will look like bellow example.
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.company.project"> <uses-permission android:name="android.permission.INTERNET"/> <uses-sdk android:minSdkVersion="18"/> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:hardwareAccelerated="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity" android:screenOrientation="landscape" android:theme="@style/FullscreenTheme" android:launchMode="singleTask"> <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> </manifest>