I'm not sure why you want to do 1), but 2) it is possible if you are ready to do a little work. You need to create a simple Android application that receives the BOOT_COMPLETED hardware event and then launches the browser. Once this application is installed, your browser will start automatically.
A little background knowledge: How to start an Android project
The application is quite simple. You need to declare that your application should digest the BOOT_COMPLETED event. You can do this in AndroidManifest.xml:
<application> ... <receiver class=".BrowserStartupIntentReceiver"> <intent-filter> <action android:value="android.intent.action.BOOT_COMPLETED" /> <category android:value="android.intent.category.HOME" /> </intent-filter> </receiver> </application>
Then you just need to implement the BrowserStartupIntentReceiver class. Its only function is to convey the intention of the OS to launch the browser.
public class BrowserStartupIntentReceiver extends IntentReceiver { @Override public void onReceiveIntent(Context context, Intent intent) { Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")); myIntent.setLaunchFlags(Intent.NEW_TASK_LAUNCH); context.startActivity(myStarterIntent); } }
This should start the browser when the emulator boots up. Although, perhaps you should not go to such lengths to avoid additional button presses.
source share