I develop mostly for iPhone and have started very recently with Android.
Tried the hello world, but when hit run the emulator just shows a black screen with an Android logo shining.
package com.hyper.tuti;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class TutiActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.main);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}
}
why is my simulator not working??
In Android Studio, go to File > Settings > Appearance & Behavior > System Settings > Android SDK . Select the SDK Tools tab and down the list make sure Intel x86 Emulator Accelerator (HAXM installer) is checked. If not, check the box, click Apply and install and restart Android Studio.
If the Android Emulator does not start properly, this problem is often related to discovering that your application's minimum SDK is higher than your emulator SDK. If that's not the case, make sure you have HAXM installer on your SDK Manager.
In newer versions of Android Studio, this is called "Wipe Data", and it is in the right-click menu for the device in the virtual device manager. This worked for me, thank you. In VS 2019, go to Android Device Manager, right click and, "factory reset". I had a black screen emulator and this resolved the problem for me.
Yeah I've had emulator boot times of 5-10 minutes initially.
Hint
When you edit your AVD, there is an option to take a snapshot. What this does is when you close your AVD, it takes a snapshot and opens that next time, bypassing boot.
Edit 1/9/2014
I have recently gotten back into Android development, and I now use Genymotion to run my emulators. It is based off of VirtualBox - it runs incredibly fast. I have not tried the Android Emulator in years so I cannot say whether or not it is any faster. I know my emulators start up almost instantly now and are not slow and buggy like before.
give it time... it takes a WHILE to boot up! (seriously)
Haha I had the same problem first time I used the emulator too. But yes it just takes alot of time to boot it up, especially if you're booting it up for Android 3.0+ Honeycomb(platform 11+) wich in effect is the tablet platform.
Use Android 2.3 Gingerbread or Android 2.2 Froyo if you want your emulator to look like an android phone.
Configure your AVD settings to use platform version 10 or 8.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With