http://blog.csdn.net/lincyang/article/details/44680629

重要文件下载地址:

(1)http://dl-ssl.google.com/android/repository/sources-22_r01.zip 
(2)http://dl-ssl.google.com/android/repository/tools_r24.1.2-windows.zip 
(3)http://dl-ssl.google.com/android/repository/android-22_r01.zip 
(4)http://dl-ssl.google.com/android/repository/samples-22_r05.zip 
(5)http://dl-ssl.google.com/android/repository/build-tools_r21.1.2-windows.zip 
(6)http://dl-ssl.google.com/android/repository/build-tools_r22-windows.zip 
(7)http://dl-ssl.google.com/android/repository/build-tools_r22.0.1-windows.zip 
(8)http://dl-ssl.google.com/android/repository/docs-22_r01.zip 
(9)http://dl-ssl.google.com/android/repository/sysimg_x86-22_r01.zip 
(10)http://dl-ssl.google.com/android/repository/sysimg_x86_64-22_r01.zip 
(11)http://dl-ssl.google.com/android/repository/sysimg_arm-22_r01.zip 
(12)http://dl-ssl.google.com/android/repository/haxm-windows_r05.3.zip

按照惯例,linux版本的只需将上述地址中的windows换成linux即可。

SDK目录结构

1.docs 
:/opt/sdk$ lsadd-ons  build-tools  docs extras  platforms  platform-tools  samples  sources  system-images  temp  tmp  tools

只需将原来的docs目录重命名,如docs-21,将最新的docs-22解压即可。文档是学习Android新feature的重要途径,一定要重视。 
2.sources 
API源码,另一个重要的学习资料。将其解压到sources目录下,最好将其api号标好,比如我这里:

$ ls sources/android-14 android-15 android-16 android-17 android-18 android-19 android-21 android-22

3.samples 
例子是学习的第三个途径。将其放入samples目录下即可,如下:

    

$ ls samples/android-10 android-15 android-16 android-17 android-18 android-19 android-5.1

4.platform 
这是sdk中的核心。将sources-22_r01.zip解压到platforms目录,如下:

    

$ ls platforms/android-10 android-14 android-15 android-16 android-17 android-18 android-19 android-21 android-5.1 android-L

5.编译工具 
tools_r24.1.2、build-tools_r22.0.1分别放到tools和build-tools下。 
6.sysimg 
有了5.1的platform我们就可以开发5.1的应用了,但是我们还缺少一个模拟器。这是sysimg要做的事情。 
将sysimg_arm-22_r01.zip解压到platform-tools目录下。

第一个Android5.1例子

build.gradle如下:

    

apply plugin: 'com.android.application'android {    compileSdkVersion 22    buildToolsVersion "21.1.2"    defaultConfig {        applicationId "com.linc.testapi22"        minSdkVersion 15        targetSdkVersion 22        versionCode 1        versionName "1.0"    }    buildTypes {        release {            minifyEnabled false            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'        }    }}dependencies {    compile fileTree(dir: 'libs', include: ['*.jar'])    compile 'com.android.support:appcompat-v7:22.+'}


演示如下图: 
 
 
 
 

参考: 
http://www.cnblogs.com/warnier-zhang/p/4369647.html 
http://www.cnblogs.com/yaotong/archive/2011/01/25/1943615.html

版权声明:本文为博主原创文章,未经博主允许不得转载。

更多相关文章

  1. 从零开始学习Android开发
  2. 《疯狂Android讲义》第二版目录
  3. 从零开始学习Android开发
  4. 搭建 Android(安卓)2.2 开发环境
  5. Android(安卓)源码结构
  6. 《Android/OPhone 开发完全讲义》目录
  7. Android(安卓)CTS的使用
  8. Android(安卓)之 Eclipse 导入 Android(安卓)源码
  9. Android(安卓)studio 启动问题,错误

随机推荐

  1. 如何在Ubuntu11.10(32位)下载Android4.0
  2. Android学习之界面篇(五)animateLayoutChan
  3. Unity与android互调用
  4. 在 Android(安卓)中使用 Java8 的特性!
  5. 谷歌加强Android监管,你的安卓机用起来会
  6. Android传感器的使用总结
  7. Android内存管理机制之一:low memory kill
  8. Android触摸屏事件派发机制详解与源码分
  9. [android]命令行向虚拟机发短信打电话
  10. Android像素单位