1. Check out our companion app, Forums for Android! Download from Google Play

No Hello World?

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

  1. rafhelp

    Thread Starter
    15

    Aug 8, 2010
    13
    0
    15
    Male
    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
    163

    Jul 13, 2010
    1,934
    458
    163
    Male
    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...