Start Web Helpdesk Projekte Whiteboard

Fertig . . . EclipseAndroid  Helpdesk Inhalt-Helpdesk Unten PDF


2.You need:
5.package examples.helloandroid


Developing Hello World for android under Ubuntu 11.10

You need:

	- Classic or Java Eclipse (64bit is ok)
	- JDK (openJDK is ok)
	- the android SDK for Linux (see more below)
	- the eclipse plugin Android ADT (more below)
	- a new udev rule (more below)


Eclipse is to be downloaded and unpacked (for some reason the ubuntu repository version gives errors when installing the adt plugin (something is missing.. WDS, WSD...) -> use version from

openJDK is already installed by default, sun java is not possible anymore since 11.10

download the SDK for Linux from the download page above as tar.gz and unpack it into the home folder

go into the unpacked folder under android-sdk-linux/tools and run the program called "android"


select fitting components that are needed (for htc desire s the SDK for 2.3.3, no proprietary software is requriered and such will take a LONG time to download)

after these sdk packages are installed, go to eclipse - window - install new software, add the path from the link above to the repositories

(use http if ssl connection doesn't work)

after installing restart eclipse and you're able to create a new Android Project from the menues and run the emulator BUT to run it on the real device first a new udev rules must be created as described in


which contains one line:

 SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev" 

0bb4 is HTC Vendor, 666 is read and write rights, every ubuntu users belongs to plugdev

after that run

 chmod a+r /etc/udev/rules.d/51-android.rules


connect the device, go in the android menu to applications, enable unknown sources, and enable debugging mode

connected devices can be listed with the programm "adb" with parameter 'devices' from

 /home/account/android-sdk-linux/platform-tools/adb devices

if there's a ???????? device, reconnect the phone or restart everything and the htc device is listed

NOW with a click on RUN in eclipse the program is run on the phone and stays on the phone, the following java code will display a hello world program, but before running double click the manifest and set in the application register debugable as true


when getting ??????? device in adb device list

 SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"

Quotation marks for values, suse does not have plugdev group, leave empty

udevadm control --reload
./adb kill-server
./adb start-server
./adb devices

/home/user/bin/android-sdk-linux/platform-tools/adb devices
List of devices attached 
HT13GTJ19428    device

package examples.helloandroid

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

public class HelloAndroidActivity extends Activity {
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
        TextView tv = new TextView(this);
        tv.setText("Hallo HTC");
Datenschutz Impressum