=================================================================
方式一、 安装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
- install JDK, add JAVA_HOME as win-system environment variable, JAVA_HOME is JDK installed directory.
- add %JAVA_HOME%\bin to path environment variable.
1. 安装最新版eclipse: http://www.eclipse.org/downloads/
2. 安装ADT
方式一: 在线安装 (需要设置proxy代理,适用vpn翻墙)
参考http://developer.android.com/sdk/installing/installing-adt.html
- 打开Eclipse, 在菜单栏上选择 help->Install New SoftWare
- 点击 Add按钮, Name: Android, Location: https://dl-ssl.google.com/android/eclipse/
- 一直Next在安装Android Development Tools等。
- 最后点击Yes按钮,重启Eclipse。
方式二: 离线安装 (推荐)
- 下载: ADT-23.0.6.zip
- 重复上述方式一的1234步骤。
3. 安装Android SDK
- 打开网址:http://www.androiddevtools.cn/, 下载android-sdk_r24.1.2-windows.zip
- http://developer.android.com/tools/sdk/eclipse-adt.html这里是adt和sdk的对应关系。ADT23.0.6对应SDK24.1.2。
- 建议将Eclipse、离线下载的ADT和Android SDK压缩包解压到C盘例如adt-bundle-windows(自定义)目录下。
- 打开Eclipse,点击菜单window->preferences->Android,SDK Location: C:\adt-bundle-windows\android-sdk-windows,点击OK确定。
- 点击菜单window->Andriod SDK Manager,打开Manager界面,点击菜单Tools->Options,设置proxy
- Http Proxy Server: mirrors.opencas.cn
- Http Proxy Port: 80
- 选中Use download cache
- 选中Force https://... sources to be fetched using http://...
- 选中Enable Preview Tools
- 通过Andriod SDK Manager, 安装或谨慎更新:Android SDK Tools、Android SDK Platform-tools、Android SDK Build-tools(22.0.1)、
Android 5.1.1(API 22)->SDK Platform & ARM EABI v7a System Image & Google APIs、
Extras->Android Support Library & Google USB Driver
- 谨慎更新:Elipse->Help->Check for Updates
- 将C:\adt-bundle-windows\android-sdk-windows\platform-tools添加到path系统环境变量中
注:
可以直接通过www.androiddevtools.cn,安装ADT Bundle,包含了Eclipse、ADT插件和SDK Tools,是已经集成好的IDE,只需安装好Jdk即可开始开发。
相关网址