No Hello World?


Last Updated:

  1. rafhelp

    rafhelp Banned This Topic's Starter

    Joined:
    Aug 8, 2010
    Messages:
    13
    Likes Received:
    0
    I installed all files following the website. I installed and am using eclipse with the android plugins.

    I set up the AVD (virtual device/emulator)

    I created a new application and added the following code from the website found here:

    Code (Text):
    1. package com.example.helloandroid;
    2.  
    3. import android.app.Activity;
    4. import android.os.Bundle;
    5. import android.widget.TextView;
    6.  
    7.  
    8. public class HelloAndroid extends Activity {
    9.        /** Called when the activity is first created. */
    10.        @Override
    11.        public void onCreate(Bundle savedInstanceState) {
    12.            super.onCreate(savedInstanceState);
    13.            TextView tv = new TextView(this);
    14.            tv.setText("Hello, Android");
    15.            setContentView(tv);
    16.        }
    17.     }
    When I click on run i get a blank black screen with the words ANDROID in the screen middle with a flashing underscore. So why is it not working?
     

    Advertisement
  2. jonbonazza

    jonbonazza Well-Known Member

    Joined:
    Jul 13, 2010
    Messages:
    1,934
    Likes Received:
    458
    You're not doing anything wrong. Every time you restart the Eclipse IDE, the first run of the emulator starts up really slow... Give it a few mins and it will eventually start up. After the first time of the session it will start much faster. Also, another thing to keep in mind is that once you start it once, you can just leave it open and keep recompiling the source and it will automatically uninstall and reinstall the apk so that saves you from having to shutdown and restart every time you make changes to your code. Hope this helps.
     

Share This Page

Loading...