第一个App

开发环境

安装JDK和JRE

下载安装文件并安装:

  • jdk-8u11-windows-i586.exe
  • jre-8u11-windows-i586.exe

使用google提供的adt-bundle,直接解压到本地即可使用,使用版本如下:

  • adt-bundle-windows-x86-20131030.zip

第一个android工程

打开eclipse如下图所示:

enter image description here

新建工程

新建一个工程,取名为FirstApp,使用默认设置 。

 File->New->Android Application Project

enter image description here

一路next直到finish

Build Project

Project->Build Project

调试

调试使用的手机型号:MI 3W    

按如下方式打开usb调试选项:

 1. 进入【设置】->【关于手机】连续点击【Android 版本】5次  
 2. 后退至【设置】可看到【开发者选项】  
 3. 进入【开发者选项】
 4. 打开【USB 调试】  

首次连接手机会安装驱动,等待驱动安装成功。

进入adt-buldle安装目录下的sdk\platform-tools目录如下输入如下指令: enter image description here

看到device字样说明设备成功识别了。

运行程序

【Run】->【Run As】->【1 Android Application】

点击后可在Console窗口中看到:

enter image description here

在手机中同意安装应用,安装完成后自动运行如下图:

enter image description here

第一个App成功运行。

Android学习-2:App工程文件分析 https://www.b453m.com/article/118117