• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Emulator just says Android on it

piller187

Newbie
I have everything setup to my knowledge but when I run the simple hello world example on the android website and run the emulator I just see a black screen that says Android with a flashing _ after it and not my Hello World text.

It's like the emulator isn't running my code. Is there some extra steps to make the emulator when I press Run, actually run my code?

Thanks
 
Depending on your computer it can take a while before it will work. Also double check all your syntax and make sure you followed the directions exactly. You could also download the SDK and use eclipse and either use a virtual machine or connect your android device in USB debugging mode
 
Thanks for the reply.

The code is very simple:
Code:
package com.example.helloandroid;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class HelloWorldActivity 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);
    }
}

Here is the console code when I run the program:

Code:
[2011-06-18 16:38:21 - HelloWorld] ------------------------------
[2011-06-18 16:38:21 - HelloWorld] Android Launch!
[2011-06-18 16:38:21 - HelloWorld] adb is running normally.
[2011-06-18 16:38:21 - HelloWorld] Performing com.example.helloandroid.HelloWorldActivity activity launch
[2011-06-18 16:38:21 - HelloWorld] Automatic Target Mode: Preferred AVD 'my_avd1' is not available. Launching new emulator.
[2011-06-18 16:38:21 - HelloWorld] Launching a new emulator with Virtual Device 'my_avd1'
[2011-06-18 16:38:26 - HelloWorld] New emulator found: emulator-5554
[2011-06-18 16:38:26 - HelloWorld] Waiting for HOME ('android.process.acore') to be launched...

Here is the 2 screenshots of what I see when I run it. It'll show the first screenshot for 30 seconds or so then go to the 2nd screenshot but it never shows my text.

android1.png





android2.png
 
How long have you let it run without stopping, it looks like it is running fine and waiting for the OS to fully load on the emulator, the emulator is dreadfully slow
 
Wow, you are right. I let it sit for 2 mins and then it finally comes up. Then I have to unlock it, then select my program. That's seriously how you have to test your applications for Android? That's horrendous! I guess I'll have to change my habits of making one small change to code and then running to test if it's going to take that long to test the functionality. Simply amazing :(

Thank you for your reply. Any tips around this since it's so much slower than any other programming one would do on the PC?
 
Wow, you are right. I let it sit for 2 mins and then it finally comes up. Then I have to unlock it, then select my program. That's seriously how you have to test your applications for Android? That's horrendous! I guess I'll have to change my habits of making one small change to code and then running to test if it's going to take that long to test the functionality. Simply amazing :(

Thank you for your reply. Any tips around this since it's so much slower than any other programming one would do on the PC?

Yes,
Always leave the emulator running when you are programming/testing/debugging your program.

It will not be as slow to start your application on subsequent runs.

But as soon as you terminate the emulator, you will have to wait for it to start up and load again.
(Which is a brutal wait)

Or better yet, if you have a real Android phone, debug on it instead.
It is so much faster to do, and really easy to do as well.

Good Luck!
Scott
 
Oh you can leave the emulator running? How does that work because I just code, then press run and it'll run the emulator and my code. So if I have the emulator running and then update my code, how do I get my changed code inside the running emulator?
 
Oh you can leave the emulator running? How does that work because I just code, then press run and it'll run the emulator and my code. So if I have the emulator running and then update my code, how do I get my changed code inside the running emulator?

Leave the emulator running. Then use the SDK provided adb tool to do uninstall and install.

E.g
assume adb is installed in <SDK>\tools
<SDK>\tools\adb uninstall <package name>
<SDK>\tools\adb install <apk filename>
 
Back
Top Bottom