This application is for the application as an application to run on your device. Creating a class extends BroadCast receiver
public class BootUpReciever extends BroadcastReceiver
{
@Override
public void onReceive(final Context context, Intent intent) {
Intent i = new Intent(context, ServerPreferenceActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
}
Add permissions for the manifest file to access the boot receiver
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
, Broadcast receiver manifest.xml
<receiver android:enabled="true" android:name="com.app.reciever.BootUpReciever">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>