操作系统:Ubuntu 11.10 x64
目标:安装 Eclipse Android SDK Java
先安装Android SDK,再安装eclipse
http://www.cnblogs.com/sink_cup/archive/2011/10/31/ubuntu_x64_android_sdk_java.html
安装Eclipse Classic
下载Eclipse Classic Linux 64 Bit
http://www.eclipse.org/downloads/?osType=linux
安装Eclipse ADT
下载ADT-14.0.0.zip
http://developer.android.com/sdk/eclipse-adt.html#troubleshooting
Eclipse -》 Help -》 Install New Software -》 add,选择下载的zip
重启eclipse
Eclipse -》Window -》 Preferences -》 Android
设置SDK Location,选择目录android-sdk-linux
关闭eclipse。
开始Android Java hello world
http://developer.android.com/resources/tutorials/hello-world.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
packagewhat.ever; importandroid.app.Activity; importandroid.os.Bundle; importandroid.widget.TextView; publicclassHelloWorldActivity extendsActivity { /** Called when the activity is first created. */ @Override publicvoidonCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView tv = newTextView(this); tv.setText("Hello, Android Java"); setContentView(tv); } } |
编译后直接安装到手机里
eclipse -》 window -》 Show View -》 other -》 device, 在device界面中选择你手机的名字就行了。
Eclipse调试Android
eclipse -》 window -》 Open Perspective -》 other -》 DDMS
参考资料:
http://developer.android.com/sdk/installing.html