4

Just finished coding an application, and now I want to test it.

When I launch the AVD emulator from eclipse, it comes up with a black screen that says "android" in blue. I setup my AVD correctly, and made sure everything is "by the book". Everything I did is in fragment_main.xml and MainActivity.java. I didn't even touch activity_main.xml.

Could this be happening because I do not have anything in my activity_main.xml file?

I tried running the AVD first, then the program, and vice-versa. Tried looking for an answer on google, but i can't find anything about my question. Any help is greatly appreciated.

Thank you!

DanFC
  • 258
  • 2
  • 10

1 Answers1

2

It is actually waiting for the OS to be loaded on the emulator. This usually takes a few minutes depending upon the configuration of the system you are using.

Just wait for a few minutes and you would be able to see the usual Android OS loaded on the emulator.

The usual console output when you launch an app on a new emulator is something like:

[2013-06-17 16:06:52 - FirstRun] New emulator found: emulator-5554
[2013-06-17 16:06:52 - FirstRun] Waiting for HOME ('android.process.acore') to be launched...
[2013-06-17 16:08:00 - FirstRun] HOME is up on device 'emulator-5554'
[2013-06-17 16:08:00 - FirstRun] Uploading FirstRun.apk onto device 'emulator-5554'
[2013-06-17 16:08:01 - FirstRun] Installing FirstRun.apk...
[2013-06-17 16:08:30 - FirstRun] Success!
[2013-06-17 16:08:30 - FirstRun] Starting activity dev.swm.firstrun.MainActivity on device emulator-5554
[2013-06-17 16:08:32 - FirstRun] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=dev.swm.firstrun/.MainActivity }
Swayam
  • 16,294
  • 14
  • 64
  • 102
  • And no, even if you don't have anything in your layout files, at least the emulator should load the Android OS on the AVD. – Swayam May 05 '14 at 06:14
  • Thank you for this. I wasn't sure why it's not working. I will try to launch it again and wait for it to load this time. – DanFC May 05 '14 at 06:54
  • 1
    You are welcome! The loading time depends on the configuration of your development system and also the amount of RAM assigned to the AVD. – Swayam May 05 '14 at 06:56
  • You can find more details here : http://stackoverflow.com/questions/3692363/android-avd-not-showing-anything-only-android-in-the-middle-of-the-screen – Swayam May 05 '14 at 06:57
  • After reading your link I understand the reasoning behind the loading time. When i created the AVD I didn't give it too much ram, and I am also not running the latest hardware. It's a late 2012 macbook pro. Once again, great help! – DanFC May 05 '14 at 06:59
  • Great that you figured the problem out! Good luck ahead! Cheers! :) – Swayam May 05 '14 at 07:07