Android practices: Android 5.1 SDK download and configuration, and android practices
Important files:
(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
Http://dl-ssl.google.com/android/repository/build-tools_r22-windows.zip
Http://dl-ssl.google.com/android/repository/build-tools_r22.0.1-windows.zip
Http://dl-ssl.google.com/android/repository/docs-22_r01.zip
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
Http://dl-ssl.google.com/android/repository/sysimg_arm-22_r01.zip
Http://dl-ssl.google.com/android/repository/haxm-windows_r05.3.zip
In linux, you only need to replace windows with linux in the preceding address.
SDK directory structure
:/opt/sdk$ lsadd-ons build-tools docs extras platforms platform-tools samples sources system-images temp tmp tools
1. docs
Just rename the original docs directory, such as a docs-21, and unzip the latest docs-22. Documents are an important way to learn about the new feature of Android.
2. sources
API source code, another important learning material. Decompress it to the sources directory. It is best to mark its api number, for example, here:
$ ls sources/android-14 android-15 android-16 android-17 android-18 android-19 android-21 android-22
3. samples
The example is the third way to learn. Put it in the samples directory, as shown below:
$ ls samples/android-10 android-15 android-16 android-17 android-18 android-19 android-5.1
4. platform
This is the core of the sdk. Decompress sources-22_r01.zip to the platforms directory, as shown below:
$ ls platforms/android-10 android-14 android-15 android-16 android-17 android-18 android-19 android-21 android-5.1 android-L
5. Compilation tools
Tools_r24.1.2 and build-tools_r22.0.1 are placed under tools and build-tools respectively.
6. sysimg
With the 5.1 platform, we can develop 5.1 applications, but we still lack a simulator. This is what sysimg wants to do.
Extract sysimg_arm-22_r01.zip to the platform-tools directory.
First Android5.1 example
Build. gradle is as follows:
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.+'}
Demo:
Refer:
Http://www.cnblogs.com/warnier-zhang/p/4369647.html
Http://www.cnblogs.com/yaotong/archive/2011/01/25/1943615.html