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

Apps No Hello World?

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:
package com.example.helloandroid;

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


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

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?
 
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:
package com.example.helloandroid;

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


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

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?

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.
 
Back
Top Bottom