Android Emulator is not responding to program
Ok Folks I decided to try this developer thing, and after about a dozen tutorials, ended up with the following Hello World type program:
package com.example.helloandroid;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);}
}
Simple enough, So I go to compile it and I get this
[2011-03-14 00:11:25 - HelloAndroid] Android Launch!
[2011-03-14 00:11:25 - HelloAndroid] adb is running normally.
[2011-03-14 00:11:25 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2011-03-14 00:11:25 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'my_avd'
[2011-03-14 00:11:25 - HelloAndroid] Launching a new emulator with Virtu开发者_StackOverflow中文版al Device 'my_avd'
[2011-03-14 00:11:30 - HelloAndroid] New emulator found: emulator-5554
[2011-03-14 00:11:30 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...
Or if I have the emulator already up, I get this
[2011-03-14 08:23:09 - HelloAndroid] Android Launch!
[2011-03-14 08:23:09 - HelloAndroid] adb is running normally.
[2011-03-14 08:23:09 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2011-03-14 08:23:09 - HelloAndroid] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'my_avd'
[2011-03-14 08:23:09 - HelloAndroid] WARNING: Application does not specify an API level requirement!
[2011-03-14 08:23:09 - HelloAndroid] Device API version is 7 (Android 2.1-update1)
[2011-03-14 08:23:09 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'
[2011-03-14 08:23:09 - HelloAndroid] Installing HelloAndroid.apk...
[2011-03-14 08:23:26 - HelloAndroid] Success!
[2011-03-14 08:23:27 - HelloAndroid] Starting activity com.example.helloandroid.HelloAndroid on device emulator-5554
And then the emulator comes up everytime with just this blank screen, with the text "android" on it. And it sits there for about 3 minutes until it goes to another blank black screen with "android" except its animated. I have looked around and can't seem to find anyone who has the same problem. Its like the emulator does not even recognize anything I am doing. Here is a nice screenshot of the blank nothingness:
So, any ideas what I did wrong?
Try waiting for the emulator to load everything before lunching your app.
That's the startup screen for the emulator... It takes a while to boot the emulator, but once it is up and running, it should fire up your application.
The first typed font is the bootstrapping stage, and then the animated version is when it is loading the OS. The next screen should be your Android platform with a GUI.
I too had the same issue. The program should be executed only after the emulator is ready to run it. So wen u open eclipse press the run button and wait for some time. This will indirectly start the emulator. Once it is loaded press the run button again, this time to run the program.
I had this issue too. My problem was the SDK version. I installed versions 3.1, 3.2 and 2.2 on my Eclipse and I created 3 different target machines. SDK versions 3.1 and 3.2 did not work whereas version 2.2 did go through. I guess there is no stable emulator for SDK 3.*. If you really need to use such a SDK version you might consider using an actual device. My system: Ubuntu 10.04 running Eclipse 3.5.2.
Hope this helps.
when you open the eclipse then go the run tab and run the emulator and appears the GUI screens in emulator then run the application.and then here after use the same emulator dont close.it take a more time to run the emulator. if your system slow.
Try using Genymotion. You can download a version for Windows/Mac OS X/Linux after registering. A plugin for Eclipse is also avaliable.
i give you link Genymotion Emulator please download and setup.
as per my experience Genymotion Vertual device is faster then android emulator.
after you get result
HelloAndroid] Starting activity com.example.helloandroid.HelloAndroid on device emulator-5554
on you console click on menu button and try to see output
精彩评论