1. Are you ready for the Galaxy S20? Here is everything we know so far!

No Hello World?

Discussion in 'Android Development' started by rafhelp, Aug 15, 2010.

  1. rafhelp

    Thread Starter

    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;
    3. import android.app.Activity;
    4. import android.os.Bundle;
    5. import android.widget.TextView;
    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?

  2. jonbonazza

    jonbonazza Android Expert

    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