tags:

views:

3985

answers:

1

I'm not sure how to autostart an android application after the android emulator completes its booting. Does anyone have any code snippets that will help me?

+8  A: 

If by autostart you mean auto start on phone bootup then you should register a BroadcastReceiver for the BOOT_COMPLETED Intent. Android systems broadcasts that intent once boot is completed.

Once you receive that intent you can launch a Service that can do whatever you want to do.

Keep note though that having a Service running all the time on the phone is generally a bad idea as it eats up system resources even when it is idle. You should launch your Service / application only when needed and then stop it when not required.

Prashast