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

Hello Android Not working

Discussion in 'Android Development' started by jplamb, Sep 12, 2010.

  1. jplamb

    jplamb Member
    Thread Starter

    I am trying to get the hello android code working and am not having any luck. There are a few things that are different.

    When i load Eclipse with a new project the code that is already there looks like this;
    when the developers site stays it should look like this (I cahnaged the package name to helloandroid2 as i made a mess of the first one so started again)

    After i have entered the code which is on the developers site it looks like this

    When the site says it should look like

    package com.android.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);

    }
    }
    [/Quote]

    I am not sure which version of the code i should be using, When i run the emulator it takes a bit of time to load and then comes up with the homescreen.

    when i try to run the app in Eclipse it says. "no compatible Targets were found. Do you wish to add a new Android Virtual Device?"

    I click yes it comes up with the options for a new device and if i click no it comes up with the AVD's that i have previously made, when i select one and tell it to start this is when it comes up with the Homescreen.

    I am using the lasest version of Eclipse ( i think) i got it from the website

    and i have downloaded the Android SDK and AVD Manager and updated them both to have all of the packages.

    Any help on how i can get this to work would be great, Thank you for reading

    James
     



    1. Download the Forums for Android™ app!


      Download

       
  2. lexchandra

    lexchandra Lurker

    the emulator is slow, but the code should be alright..

    have you created an AVD? maybe that is the problem
     
Loading...

Share This Page

Loading...