1. Download our Official Android App: Forums for Android!

Emulator just says Android on it

Discussion in 'Android Apps & Games' started by piller187, Jun 18, 2011.

  1. piller187

    piller187 Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    10
    Joined:
    Jun 18, 2011

    Jun 18, 2011
    10
    0
    15
    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
     

    Advertisement

  2. Yeahha

    Yeahha Usually off topic
    Rank:
    None
    Points:
    813
    Posts:
    10,472
    Joined:
    Jul 29, 2010

    Jul 29, 2010
    10,472
    4,693
    813
    ...
    FG
    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
     
  3. piller187

    piller187 Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    10
    Joined:
    Jun 18, 2011

    Jun 18, 2011
    10
    0
    15
    Thanks for the reply.

    The code is very simple:
    Code (Text):
    1.  
    2. package com.example.helloandroid;
    3.  
    4. import android.app.Activity;
    5. import android.os.Bundle;
    6. import android.widget.TextView;
    7.  
    8. public class HelloWorldActivity extends Activity {
    9.     /** Called when the activity is first created. */
    10.     @Override
    11.     public void onCreate(Bundle savedInstanceState)
    12.     {
    13.         super.onCreate(savedInstanceState);
    14.        
    15.         TextView tv = new TextView(this);
    16.         tv.setText("Hello, Android");
    17.         setContentView(tv);
    18.     }
    19. }
    20.  
    Here is the console code when I run the program:

    Code (Text):
    1.  
    2. [2011-06-18 16:38:21 - HelloWorld] ------------------------------
    3. [2011-06-18 16:38:21 - HelloWorld] Android Launch!
    4. [2011-06-18 16:38:21 - HelloWorld] adb is running normally.
    5. [2011-06-18 16:38:21 - HelloWorld] Performing com.example.helloandroid.HelloWorldActivity activity launch
    6. [2011-06-18 16:38:21 - HelloWorld] Automatic Target Mode: Preferred AVD 'my_avd1' is not available. Launching new emulator.
    7. [2011-06-18 16:38:21 - HelloWorld] Launching a new emulator with Virtual Device 'my_avd1'
    8. [2011-06-18 16:38:26 - HelloWorld] New emulator found: emulator-5554
    9. [2011-06-18 16:38:26 - HelloWorld] Waiting for HOME ('android.process.acore') to be launched...
    10.  
    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.

    [​IMG]




    [​IMG]
     
  4. Yeahha

    Yeahha Usually off topic
    Rank:
    None
    Points:
    813
    Posts:
    10,472
    Joined:
    Jul 29, 2010

    Jul 29, 2010
    10,472
    4,693
    813
    ...
    FG
    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
     
  5. piller187

    piller187 Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    10
    Joined:
    Jun 18, 2011

    Jun 18, 2011
    10
    0
    15
    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?
     
  6. ScottK

    ScottK Newbie
    Rank:
    None
    Points:
    16
    Posts:
    10
    Joined:
    Jun 18, 2011

    Jun 18, 2011
    10
    2
    16
    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
     
  7. piller187

    piller187 Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    10
    Joined:
    Jun 18, 2011

    Jun 18, 2011
    10
    0
    15
    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?
     
  8. Yeahha

    Yeahha Usually off topic
    Rank:
    None
    Points:
    813
    Posts:
    10,472
    Joined:
    Jul 29, 2010

    Jul 29, 2010
    10,472
    4,693
    813
    ...
    FG
    I would suggest using USB debugging on your phone it is faster
     
  9. sohguanh

    sohguanh Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    427
    Joined:
    Apr 18, 2010

    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>
     
  10. piller187

    piller187 Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    10
    Joined:
    Jun 18, 2011

    Jun 18, 2011
    10
    0
    15
    Is there a way to do this from eclipse or do I need to use the command line?
     

Share This Page

Loading...