打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Android实战技巧之二十二:Android 5.1 SDK下载与配置

重要文件下载地址:

(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目录结构

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

1.docs
只需将原来的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
  • 1
  • 2

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

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

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
  • 1
  • 2

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.+'}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25

演示如下图:





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

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
linux安装安卓开发工具android studio
Android SDK4.0离线快速安装方法(一小时内安装完毕,亲测)
出现“adb不是内部或外部命令,也不是可运行的程序或批量文件。”
模拟器如何安装apk文件
android 调试进入sdk源码
AndroidSDK source (linux平台下)下载和附加到eclipse里
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服