android平台的搭建(转载)
2012-06-11 21:14
260 查看
Setup Android Development Environment- Complete Tutorial
Here starts our Android Development tutorial. In this article, you will find how to setup a complete Android Development environment. This includes download, installation and configuration of various software components required to form a complete IDE. AsI said in the Introduction,
I’ve tried to keep things as simple as I could. And all you’re supposed to do is to follow some simple steps only. That’s it, not any big deal (Android Development itself is not a big deal and here it is made even more simpler).
This tutorial is based on Windows platform as I’m currently developing on Windows. The setup procedure for Linux and Mac platforms don’t make much difference and all tools required are available for that platforms also. Two things you are required to have is
a computer and an internet connection- preferably a high speed one. This is because all those components you are going to download will together consist of several hundreds of megabytes. If you have a low speed dial-up data connection, it will take much time
to complete.
![](http://www.android-app-market.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif)
These are the components you require to setup your Android IDE:
Java Development Kit
Android SDK
Eclipse
Now its time to download these one by one:
JDK(Java Development Kit)
It is the most important one as it forms the base for all other tools. It consists of Java Run time Environment and developer tools. For everything we are going to do here, JDK is required. To download Java SE JDK go to the Java SE download page of Oracle
here:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
![](http://www.android-app-market.com/wp-content/uploads/2012/02/jdk.jpg)
Accept the Licence agreement and select the platform
Android SDK
Android SDK is the collection of various tools and libraries which is designed to be linked with the development software we are using and make the development environment Android-specific. In our case it is to be linked with the Eclipse (Eclipse is not the
only development environment for Android. We use it here ‘cause it is the most popular and simple to work with). Download the latest Android SDK from Android Developers website
You can download either the executable installation file or the compressed archive. Both are same.
http://developer.android.com/sdk/index.html
![](http://www.android-app-market.com/wp-content/uploads/2012/02/sdk.jpg)
Eclipse
Eclipse is the highly popular IDE for Java and here we are going to make it an Android specific IDE by installing the ADT plugin and linking with the Android SDK. That is, you are going to do all your coding, testing and debugging works in the Eclipse.
Before downloading the Eclipse, make sure that it is compatible with the Android SDK you’ve just downloaded before.
Currently Eclipse Classic is the recommended version
Download it from here:
http://www.eclipse.org/downloads/
![](http://www.android-app-market.com/wp-content/uploads/2012/02/eclipse.jpg)
Installation:
We’ve completed downloading all the tools essential to start with, now we’ll see how to install these components.
JDK
Installation of the Java SE is a relatively painless task. I think it doesn’t need much explanation. It is an executable installation package and install it like any other software packages. Leave the default packages and installation location unchanged and
proceed. After it completes installing JDK, will ask the location for JRE to be installed. No need to change the default location. Click next. After the successful completion of the installation, it will show you a window like this. Click continue
Android SDK
If you’ve downloaded the zip file of Android SDK, then you need to unzip the archive into the C: drive of your computer such that the software goes into C:/ android-sdk-windows folder (in case of Windows platform). If you downloaded the installation package
of Android SDK then install it by setting the installation location to your C:/ root folder.
Eclipse
Eclipse is also zip archive and doesn’t need installation. Just extract the zip file and place it in your C: drive such that the Eclipse software is in C:/Eclipse folder. Then go to that Eclipse folder and find a file namedEclipse.exe.
Right click on the file and select Create Shortcut. Copy the shortcut and place it in you desktop.
ADT Plugin for Eclipse
ADT is a custom plugin for Eclipse to give a powerful integrated IDE for Android Development. It allows user to develop, run and debug Android Applications.
Open Eclipse by double clicking the Eclipse shortcut on the desktop. It will ask for the default workspace location. Set it as C:/ Eclipse workspace and continue.
Eclipse window appears. Go to Help->Install New Software
![](http://www.android-app-market.com/wp-content/uploads/2012/02/Eclipse-ADT.jpg)
In the new window click Add
![](http://www.android-app-market.com/wp-content/uploads/2012/02/Eclipse-ADT2.jpg)
Add Repository window opens
In the name field enter ‘ADT’
In the location field add the URL https://dl-ssl.google.com/android/eclipse/ href="http://www.android-app-market.com/wp-content/uploads/2012/02/add-repository.jpg" target=_blank>
![](http://www.android-app-market.com/wp-content/uploads/2012/02/add-repository.jpg)
Click OK
If any trouble occurs in downloading, use http in place of https in the URL
In the next window, you will see the list of files to be downloaded. Click Next
![](http://www.android-app-market.com/wp-content/uploads/2012/02/Eclipse-ADT3.jpg)
Next window shows the review of files to be installed. Click Next. Accept the Apache license and continue.
After the installation completes, it will ask you to whether restart the eclipse or not. Click restart Now
![](http://www.android-app-market.com/wp-content/uploads/2012/02/ADT-finish.jpg)
When Eclipse restarts, configure SDK window appears. Select Use existing SDK option and browse the folder C:/ android-sdk-windows and
click Finish.
![](http://www.android-app-market.com/wp-content/uploads/2012/02/sdk-setup.jpg)
Adding Platform Packages to the Android SDK
We’ve downloaded the Android SDK, but we can’t start development with the Android SDK as it is. This is because it doesn’t contain any packages. We need to add packages to the Android SDK. Packages are specific to a particular version of Android, for example,
if we are planning to develop for 2.3, then we want to install the platform packages for Android 2.3 that is API-10. Suppose we want to support the earlier versions of Android and want to test whether our app works without errors in the earlier versions or
not. Then we need each of those platforms of the Android versions we are planning to add support to.
Open Android SDK manager. You can open it from its folder or by just clicking the Android SDK manager button on the SDK toolbar.
![](http://www.android-app-market.com/wp-content/uploads/2012/02/Eclipse-SDK-AVD.jpg)
When opens, it will automatically show the packages available for download.
Expand tools on the left. Select SDK tools and SDK platform tools.
![](http://www.android-app-market.com/wp-content/uploads/2012/02/SDK-update.jpg)
To select the required packages expand them. Select SDK packages and samples
for SDK and GoogleAPI. You need not install the third party SDKs unless you are programming for a particular device.
(Google API is also not mandatory, it is required only if we use any Google APIs in our application. For simple applications, it isn’t required) As a beginner, you need to download SDK platform and samples for Android 2.3. Select Google USB driver package
under extras, if you want to test your app on a physical device.
After selecting, click Install Packages.
In the next window, the components we’ve selected appears as a list and we can make a review. To reject a package, select it and click Reject.
![](http://www.android-app-market.com/wp-content/uploads/2012/02/SDK-update2.jpg)
After making the final list of components, click install.
Setup Android Virtual Device
The final step is to configure an Android Virtual Device. Android Virtual Device is the Android emulator on which we are run our program. We can create an AVD to match with the configurations of any Android device available in the market. And there’s no limit
in the number of AVDs, we can create as many AVDs as we want in different configurations.
To create an AVD, go to Android Virtual Device Manager button in the Eclipse toolbar. Click New on the Right side.
![](http://www.android-app-market.com/wp-content/uploads/2012/02/New-AVD.jpg)
Give any name in the name field. (The name should be such that you can distinguish it later, when multiple AVDs are created). Select the target API from the drop down list. In this case, I’ve selected 2.3 as target. Enter desired size for SD card. Under skin
section, leave the default resolution, WVGA800 unchanged.
![](http://www.android-app-market.com/wp-content/uploads/2012/02/New-AVD2.jpg)
Click
create AVD.
The Android Virtual Devise you’ve just created appears on the list of AVDs. Select it and click Start
![](http://www.android-app-market.com/wp-content/uploads/2012/02/AVD_start.jpg)
Now
your AVD boots. It will take several minutes to load for the first time. After the loading is completed, it shows you an Android Home screen. This is your virtual Android devise where you are going to test- run your programs.
![](http://www.android-app-market.com/wp-content/uploads/2012/02/AVD.jpg)
Congrats! You’ve completed an important task in your Android development life. You just setup you complete Android Development Environment. You will learn more about the development environment in my upcoming posts.
Stay tuned to Android-App-Market.com for all future updates
What do you think about this article? Please add your valuable comments and feedback below
相关文章推荐
- [观点]从iOS-Android-WP7开发环境搭建感受平台风格 推荐
- Android开发平台搭建及基础知识
- Eclipse搭建android开发环境 转载出处:coder-pig
- (jenkins)hudson平台搭建android项目持续化集成以及基于NativeDriver的UI自动化测试环境
- Windows和Ubuntu平台Android +JAVA 环境搭建
- 搭建Android平台
- Android编程学习系列:第一篇,搭建开发平台
- 【转】利用用Flash Builder 4.5搭建Android 开发平台(附带模拟器)
- Android环境搭建_转载
- android开发平台下搭建junit测试框架环境
- 四、关于Java、Android编程平台的搭建问题讲解之环境配置
- Linux平台下搭建OgreKit on Android开发环境
- 使用 Jenkins 搭建 iOS/Android 持续集成打包平台 (开箱即用)
- Android平台搭建
- [转载]Android平台第三方应用分享到微信开发
- 004_在Eclipse环境下搭建Android开发平台(离线搭建)
- 关于Unity -Vuforia -Android 开发 ,平台的搭建(极品菜鸟完整版)
- wcf完美搭建android平台服务之三