Android Run at Bootup

There are two considerations for Run at Bootup.

public class SubLauncher extends Activity {
/** Called when the activity is first created. */
private static final String TAG = "NSubLauncher1";
public void onCreate(Bundle ThomasofNeedham) {
super.onCreate(ThomasofNeedham);
try {
// comment out the following three lines if you want to keep slidelock
KeyguardManager  mKeyGuardManager =  (KeyguardManager) getSystemService(KEYGUARD_SERVICE);
KeyguardLock mLock = mKeyGuardManager.newKeyguardLock("SubLauncher");
mLock.disableKeyguard();
//     end slidelock  disable

//      Intent openStartingPoint = new Intent("com.thomas.needham.HELLOWORLD");
//    Intent openStartingPoint = new Intent("com.needham.helloworldb.android.intent.action.MAIN");
Intent openStartingPoint = new Intent("anywhwheresoftware.b4a.helloworld.android.intent.action.MAIN");

Log.d(TAG, "IntentopenStartingPoint: "+ openStartingPoint );
startActivity(openStartingPoint);

} catch  (ActivityNotFoundException e) {
e.printStackTrace();
}

}
}

 

 

 

 

The first consideration is should the KeySlide be enabled?  If the application is truly embedded, then the KeySlide needs to be disabled.  This little code snippet accomplishes this.

 

 

This entry was posted in Uncategorized. Bookmark the permalink.