开发环境配置

    |     2015年3月28日   |   开发环境   |     0 条评论   |    2174

Android应用开发使用java语言

首先需要Java开发环境,参见 Java开发环境

然后下载并配置Android SDK(SDK Manager、AVD Manager)

下载 android-sdk_r24.1.2-windows.zip

执行SDK Manager.exe

 

选择相应版本SDK下载.

注:Sdk下载地址国内不能访问需要翻墙或购买vpn.也可通过如下方式下载:

Android SDK在线更新镜像服务器

  1. 中国科学院开源协会镜像站地址:
    • IPV4/IPV6: http://mirrors.opencas.cn 端口:80
    • IPV4/IPV6: http://mirrors.opencas.org 端口:80
    • IPV4/IPV6: http://mirrors.opencas.ac.cn 端口:80
  2. 上海GDG镜像服务器地址:
    • http://sdk.gdgshanghai.com 端口:8000
  3. 北京化工大学镜像服务器地址:
    • IPv4: http://ubuntu.buct.edu.cn/ 端口:80
    • IPv4: http://ubuntu.buct.cn/ 端口:80
    • IPv6: http://ubuntu.buct6.edu.cn/ 端口:80
  4. 大连东软信息学院镜像服务器地址:
    • http://mirrors.neusoft.edu.cn 端口:80

使用方法

      1. 启动 Android SDK Manager ,打开主界面,依次选择『Tools』、『Options…』,弹出『Android SDK Manager – Settings』窗口;
      2. 在『Android SDK Manager – Settings』窗口中,在『HTTP Proxy Server」和「HTTP Proxy Port』输入框内填入上面镜像服务器地址(不包含http://,如下图)和端口,并且选中『Force https://… sources to be fetched using http://…』复选框。设置完成后单击『Close』按钮关闭『Android SDK Manager – Settings』窗口返回到主界面;
      3. 依次选择『Packages』、『Reload』。

配置Android环境变量

变量名:ANDROID_SDK_HOME,

变量值是android-SDK-windows的路径,如:D:\sdk\android-sdk-windows

配置Path变量,编辑Path环境变量,变量值添加如下路径:

;%ANDROID_SDK_HOME%\platform-tools;%ANDROID_SDK_HOME%\tools;

接着集成开发环境下载与安装

Google帮你集成了一个完整的Android开发环境,包含一个定制的Eclipse + ADT plugin,以及最新的SDK及源码

相比与Eclipse更推荐使用IDEA,以后可以无缝过渡到Android Studio

首先说明这个不适合新手们使用,但是你必须知道这是Google最新推出的Android开发工具,基于IDEA,编译依赖Gradle,目前还没有推出1.0的正式版,但是你依然可以业余项目熟悉了解下,因为这也许是Android开发工具的未来

如果无论如何你都不想翻墙的话,这里github上可以直接下载以上Android开发工具

AndroidDevTools

 

SDK目录结构

重要的目录包括

【build-tools】里面是不同版本(例如23.0.1 , 21.1.1 , 21.0.2)的build工具,这些工具包括了aapt打包工具、dx.bat、aidl.exe等等

【platform】是存放不同API-level版本SDK目录的地方

【platform-tools】是一些android平台相关的工具,adb、fastboot等

【tools】是指的安卓开发相关的工具,例如android.bat、ddms.bat(Dalvik debug Monitor Service)、draw9patch.bat等等

【system-image】是不同版本虚拟设置相关软件,如模拟器cpu ….

【extras】额外包,可理解为升级新版本后为了向下兼容提供的额外包,如v4,v7,v13等

【dosc】api说明文档

【samples】google官方Demo

min sdk version、target sdk version 和 compile sdk version

1、CompileSdkVersion是你编译SDK的版本号,也就是API Level,例如API-23、API-21、API-20等等。

2、buildeToolVersion是你构建工具的版本,其中包括了打包工具aapt、dx等等。这个工具的目录位于..your_sdk_path/build-tools/XX.XX.XX

3、在ecplise的project.properties中可以设置sdk.buildtools=23.0.1。也可以不设置,不设置的话就是指定最新版本。而在android studio中是必须在build.gradle中设置。例如

compileSdkVersion   23

buildToolsVersion “23.0.1”

4、你可以用高版本的build-tool去构建一个低版本的sdk工程,例如build-tool的版本为20,去构建一个sdk版本为18的

compileSdkVersion 18

buildToolsVersion “22.0.1”这样也是OK的。

 

min sdk version Is the earliest release of the Android SDK that your application can run on. Usually this is because of a problem with the earlier APIs, lacking functionality, or some other behavioral issue.

target sdk version The version your application was targeted to run on. Ideally this is because of some sort of optimal run conditions. If you were to “make your app for version 19” this is where that would be specified. It may run on earlier or later releases, but this is what you were aiming for. This is mostly to indicate how current your application is for use in the marketplace, etc.

compile sdk version The version of android your IDE (or other means of compiling I suppose) uses to make your app when you publish a .apk file. This is useful for testing your application as it is a common need to compile your app as you develop it. As this will be the version to compile to an APK, it will naturally be the version of your release. Likewise it is advisable to have this match you target sdk version.

转载请注明来源:开发环境配置

上一篇:

下一篇:

回复 取消