Android 5.0 (API Level 22 +) 搭建(for windows)

=================================================================

方式一、 安装Android Studio

参考链接: How to Install Android Studio and Get Started

Android Studio provides everything you need to start developing apps for Android, including the Android Studio IDE and the Android SDK tools.

If you didn't download Android Studio, go download Android Studio now, or switch to the stand-alone SDK Tools install instructions.

Before you set up Android Studio, be sure you have installed JDK 6 or higher (the JRE alone is not sufficient)—JDK 7 is required when developing for Android 5.0 and higher.
To check if you have JDK installed (and which version), open a terminal and type javac -version. If the JDK is not available or the version is lower than 6, go download JDK.

To set up Android Studio on Windows:

1. Launch the .exe file you just downloaded.
2. Follow the setup wizard to install Android Studio and any necessary SDK tools.

On some Windows systems, the launcher script does not find where Java is installed. 
If you encounter this problem, you need to set an environment variable indicating the correct location.

Select Start menu > Computer > System Properties > Advanced System Properties. 
Then open Advanced tab > Environment Variables and add a new system variable JAVA_HOME that points to your JDK folder, 
for example C:\Program Files\Java\jdk1.7.0_21.

The individual tools and other SDK packages are saved outside the Android Studio application directory. 
If you need to access the tools directly, use a terminal to navigate to the location where they are installed. 
For example: 
\Users\<user>\sdk\

Android Studio is now ready and loaded with the Android developer tools,
but there are still a couple packages you should add to make your Android SDK complete.

相关网址

另:使用AndroidStudio时,运行特别慢,现在找到了一些方法予以解决。

Android Studio 启动时,会启动很多plugins,gradle 时会不停的访问网络,容易受网速限制,这都极大地影响AS的启动、编译和运行。
我从三个方面做了修改,使AS的速度有较大提高:

1、File》Settings》Plugins:
我去掉了
{
CVS Integration,Git Integration, 
GitHub, 
Google Analytics Uploader,
Google App Indexing,
Google Cloud Testing,
Google Cloud Tools Core,
Google Cloud Tools For Android Studio,
Google Login,
Google Services,
Subversion Integration,
TestNG-J
}
2、File》Settings》Build,Execution,Deployment》Build Tools》Gradle
                1) 我使用的是“use local gradle distribution"
                2)勾选上 “Offline work”

3、Windows:
C:/Users/Your computer name /.gradle  (eg. C:/Users/haihualx/.gradle)
在此目录下新建gradle.properties文件,编辑:
org.gradle.parallel=true
org.gradle.daemon=true

以上三个步骤可以减少AS打开以及运行时间。

另外:关于Android SDK的问题,直接用SDK manager 下载 sdk的不同版本以及 API和images时,通常是无法下载的,总提示服务器拒绝访问。可以直接使用Android studio,在settings中设置你本机的sdk路径,它能够自动查找所有需要的API 、Build-tools 、platforms等,下载速度比较快。

=================================================================

方式二、 Eclipse + ADT

参考链接:Android 5.0环境搭建

因为要使用API Level 22,用Eclipse还是较Android Studio顺手一些,所以侧重说明Eclips安装Android5.0以上版本的方法:

0. 安装JDK

1. 安装最新版eclipse: http://www.eclipse.org/downloads/

2. 安装ADT

方式一: 在线安装 (需要设置proxy代理,适用vpn翻墙)

参考http://developer.android.com/sdk/installing/installing-adt.html

  1. 打开Eclipse, 在菜单栏上选择 help->Install New SoftWare
  1. 点击 Add按钮, Name: Android, Location: https://dl-ssl.google.com/android/eclipse/
  1. 一直Next在安装Android Development Tools等。
  1. 最后点击Yes按钮,重启Eclipse。

方式二: 离线安装 (推荐)

3. 安装Android SDK

  • Http Proxy Server: mirrors.opencas.cn
  • Http Proxy Port: 80
  • 选中Use download cache
  • 选中Force https://... sources to be fetched using http://...
  • 选中Enable Preview Tools

注:

可以直接通过www.androiddevtools.cn,安装ADT Bundle,包含了Eclipse、ADT插件和SDK Tools,是已经集成好的IDE,只需安装好Jdk即可开始开发。

相关网址

  1. Android 开发环境配置图文教程(jdk+eclipse+android sdk)

  2. 用Eclipse4.4开发设备模拟器体验Android 5.0新功能

  3. Android SDK Manager国内无法更新的解决方案