Start Web Helpdesk Projekte Whiteboard

Fertig . . . EclipseAndroid  Helpdesk Inhalt-Helpdesk Unten PDF

inhalt

1.Links:
2.You need:
3.Start
4.openSuSE
5.package examples.helloandroid

Links:

http://developer.android.com/sdk/installing.html

http://developer.android.com/index.html

http://developer.android.com/sdk/eclipse-adt.html#installing

http://developer.android.com/sdk/index.html

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)

Start

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 www.eclipse.org

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

http://developer.android.com/sdk/index.html

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

 ./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

https://dl-ssl.google.com/android/eclipse/

(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

http://developer.android.com/guide/developing/device.html

 /etc/udev/rules.d/51-android.rules

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

THEN FINALLY

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

openSuSE

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.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class HelloAndroidActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        TextView tv = new TextView(this);
        tv.setText("Hallo HTC");
        setContentView(tv);
    }
}


www.bittnermichael.de
Datenschutz Impressum