Stept 1: Android开发所需软件开发包准备 1,JDK
|
Stept 2:Android开发环境的搭建
1,安装JDK 2,设置Android SDK 将下载的SDk解压到你喜欢的目录,我是解压到根目录D:\android-sdk-windows, 首先打开SDK Manager,安装必要的package 勾选Tools,Android 4.2.2(API 17),安装之。 然后打开AVD Manager,创建Android 虚拟设备 3,设置eclipse Help/Install New Software... 安装Android开发插件ADT(Android Development Tools) 配置Android SDK Window/Preferences |
Stept 3:创建你的第一个Android应用
1,打开eclips,选择File/New 选择Android Application Project 项目名称,包名,按自己的喜好填写 一路Next下去,Activity Name按自己喜好填写 这样我们的第一个Android Project就创建成功了。 Error Note:创建完成后可能会出现,‘R cannot be resolved to a variable ’,这个错误,原因在于R.java这个文件没有自动生成 更新一下SDK,刷新一下即可。 |
1,在你的爱机上运行
用数据线将你的爱机与电脑相连,爱机设置成‘USB’ 调试模式
2,在虚拟机中运行
[2013-05-19 23:29:22 - MyFirstApp] ------------------------------
[2013-05-19 23:29:22 - MyFirstApp] Android Launch!
[2013-05-19 23:29:22 - MyFirstApp] adb is running normally.
[2013-05-19 23:29:22 - MyFirstApp] Performing com.example.myfirstapp.MainActivity activity launch
[2013-05-19 23:29:22 - MyFirstApp] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'MX2'
[2013-05-19 23:29:22 - MyFirstApp] Uploading MyFirstApp.apk onto device 'emulator-5554'
[2013-05-19 23:29:22 - MyFirstApp] Installing MyFirstApp.apk...
[2013-05-19 23:30:30 - MyFirstApp] Success!
[2013-05-19 23:30:30 - MyFirstApp] Starting activity com.example.myfirstapp.MainActivity on device emulator-5554
[2013-05-19 23:30:34 - MyFirstApp] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.myfirstapp/.MainActivity }