Installing Google Android SDK 1.0 On Ubuntu 8.04 Desktop - Page 3

Want to support HowtoForge? Become a subscriber!
 
Submitted by falko (Contact Author) (Forums) on Wed, 2008-09-24 14:44. ::

4 Creating A First Android Application ("Hello, Android")

This example is taken from http://code.google.com/android/intro/hello-android.html. It's a good test if your Android SDK is working as expected. We will create a small application that displays Hello, Android on an Android phone.

First, we create a new project (File > New > Project...):

Select Android Project and click on Next >:

Fill out the project details as follows:

Afterwards, you should see this window (navigate to HelloAndroid > src > com.android.hello > HelloAndroid.java > HelloAndroid > onCreate(Bundle) to see the source code in the source code window). Click on the Maximize icon in the upper right corner of the source code window to maximize it:

You should then see the source code in a bigger window. Modify the code so that it looks as follows:

package com.android.hello;

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);
   }
}

Save the file. To run the code, go to Run > Run Configurations...:

Highlight Android Application and click on the icon in the upper left corner that looks like a white sheet of paper:

The following window should come up. Fill it out as shown, click on Apply...

... and then on Run:

When you do this for the first time, the following message appears. Click on Proceed to continue:

Finally, the Android emulator comes up. It can take a while until the Android phone has started up (so please be patient), but afterwards you should see Hello, Android in the display:

Congratulations, everything is working as expected!

 

5 Links


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by ashish (not registered) on Tue, 2010-11-09 05:42.

thanx

the steps were perfect

i installed android successfully. :)

Submitted by vikram (not registered) on Sat, 2009-04-25 13:30.

Thanks for a such nice how to. 10/10 !!

Submitted by rio (not registered) on Sun, 2009-04-12 08:22.

You do not need eclipse to install and develop android Application...

 Eclipse plugin is just wrapper to command line...

Take a look at my tutorial:
http://rioastamal.net/2009/04/tutorial-how-to-install-google-android-sdk-on-ubuntu-linux/

Thanks.

Submitted by Anonymous (not registered) on Tue, 2009-03-24 10:26.
worked great for ubuntu 8.10 - thanks!
Submitted by criso (not registered) on Tue, 2009-02-24 12:56.
Thanks for the instructions! Really helpful!
Submitted by Ivan (not registered) on Sun, 2009-02-01 23:18.

The instructions are perfect...I  have installed on ubuntu 8.10 (and all it's the same)

Testing the emulator on a centrino 1.5G it's slow (but you can see android without having to buy a phone)

Submitted by Ageless Stranger (not registered) on Tue, 2009-01-13 01:57.
Works in ubuntu 8.10 (intrepid), perfect Howto thanks 
Submitted by Benny Iskandar (not registered) on Sun, 2009-01-11 01:34.

Hi, I've just following steps , but it failed when performing the "Running project" action. The handset display emulator only display the text below : "Android _" .  But there is nothing happen after then . Please see the eclipse console displays the log below :

[2009-01-11 08:17:31 - Emulator] emulator: warning: opening audio output failed

[2009-01-11 08:17:31 - Emulator] [2009-01-11 08:17:31 - HelloAndroid] New emulator found: emulator-5554

[2009-01-11 08:17:31 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...

[2009-01-11 08:17:34 - Emulator] emulator: emulator window was out of view and was recentred

[2009-01-11 08:17:34 - Emulator]

Is it because the audio output failed, so i can not continue the work ? And anybody can help me to this problem ? Thanks and need your help , please .

Submitted by Anonymous (not registered) on Wed, 2008-11-26 12:56.
Thank you for such a detailed article.
Submitted by Kentamanos (not registered) on Fri, 2008-11-14 07:37.

Great article, thanks! Just a quick FYI in case anyone else has the same problem I had (I've seen other posts on other forums about it now).

If the URL for the ADT Eclipse plugin repository doesn't work (
https://dl-ssl.google.com/android/eclipse/) try it without the https, and just http (
http://dl-ssl.google.com/android/eclipse/). That worked for me (secure version kept complaining there was no repository there).

Submitted by Anonymous (not registered) on Thu, 2008-11-13 20:10.
Very clear and easy to follow. This got me going in no time. Five stars!
Submitted by Matija Grabnar (not registered) on Wed, 2008-10-22 10:19.

Clear, concise, and accurate. This is an exemplary piece of documentation that got me up and running with zero frustration.

 Thank you so very much!

Submitted by Reid Miller (not registered) on Fri, 2008-10-10 06:00.

Thanks for the guide! This combined with Google's excellent documentation and sweet emulator aught to keep me busy.

Thanks again!

Submitted by Turupache (not registered) on Sat, 2008-10-04 19:53.
- Thanks! I can't do this without you! Thanks a lot! =)
Submitted by andy (not registered) on Mon, 2008-09-29 10:00.
thanks! worked great.