original http://www.tuicool.com/articles/BBf6Fr
Statement
Welcome reprint, but please keep the original source of the article →_→
Life One number: http://www.cnblogs.com/smyhvae/
Article Source: http://www.cnblogs.com/smyhvae/p/4022844.html
Contact information: [Email protected]
Body
In my blog, I talked about using IntelliJ idea 13 to build an integrated Android development environment (graphics tutorial). The system was re-installed yesterday, so to keep up with the times, try the use of Android studio today. I've seen several blogs about how to use the Android SDK to build an Android integrated development environment, but I don't feel detailed, so I'm going to make a detailed tutorial on myself, hoping to help the novice (including myself) .
"Development Environment"
Physical machine Version: Win 7 Ultimate Edition (64-bit)
Java SDK version: jdk1.8.0_20 (64-bit)
Android SDK version: Android 4.4 (API 20)
Android Studio version: Android Studio Beta v0.8.6
Note: The physical machine version and the Java SDK version must be consistent: 64-bit or 32-bit.
First, the introduction of Android Studio:
The Android Studio IDE (Android Platform integrated development Environment) was first released by the GOOGLEI/O conference in 2013. It is based on the IntelliJ idea development environment and is designed to replace Eclipse and ADT (Android Developer tools) to provide developers with better development tools. Since Google has been trying to promote, I believe it will soon be possible to catch up with eclipse.
- Compared to the eclipse,android Studio IDE has its own features:
- Better support for UI design and code authoring makes it easy to adjust multiple resolutions on your device.
- Proguard tools and application signatures are also supported.
- However, the current version of Android Studio cannot manage multiple items in the same window. Each project opens a new window. I guess this is a reference to the behavior of IntelliJ idea, and Google will not make any adjustments to this recently.
- It's great to support the Gradle Automation build tool, but it will take some time to learn and adapt to the developers who have just moved from the Eclipse platform.
Second, the preparation of software:
Now that you're developing Android, the Java SDK and Android SDK are essential, regardless of the development environment (Android SDK is already integrated in Android Studio). After downloading, my package is as follows:
1. Installation of the Java SDK:
Download site: http://www.oracle.com/index.html
Since my operating system is 64-bit, I downloaded the 64-bit JDK version:
When the download is complete, start the installation:
, choose the installation path according to your preference.
The following need to configure the environment variables, specifically, you can refer to my other blog: Java Configuration----JDK development environment and environment variable configuration
2. Download and install Android Studio:
Download site: http://developer.android.com/index.html
Click on the text in the red box above to enter another link:
Click on the Red Box section to bring up the following interface:
Continue clicking on the Red Box section to start the download:
Once the download is complete, you can start the installation:
, select the appropriate installation path, and then continue:
Once the software is installed, the Android SDK will automatically appear in the installed directory as well:
Third, start to run the software:
Note: Once we have installed the JDK and configured the environment variables correctly, once you run Android Studio, the JDK will be loaded automatically (provided the environment variables are properly configured), and the Android SDK is already available. Start running the software now.
After the installation finishes Android studio, start running the software, and the first time you run it, the following dialog box pops up:
, is to remind you whether there is a previous version of the Android studio settings file, this file is a previous use of Android Studio user's operating habits generated an XML file, after import can directly use the previous development habits, and for new users, basic need to choose I Don ' t that one.
Then we clicked Create New project and created a project:
Note: project in Android Studio is not really project, it's a concept with workspace in Eclipse, solution in Visual Studio.
Let's take a look at the following form to find out:
Eclipse |
Ieda/android Studio |
Work area |
Workspace |
Project |
Project |
Project |
Module |
Reference |
Preference |
Module dependency |
After that, the following screen pops up:
, we have a good project name and put it in the appropriate path, then click "Next" to pop up the following interface:
, select the minimum version of the API (this is based on your individual needs). Then continue:
, select the template style. Then continue:
After the project is established, the software automatically downloads and gradle related components for a long time (because it is loaded for the first time):
Wait a moment and you'll see the project we've built:
, take a closer look at the directory structure of the project files, as well as the loaded libraries (including the Android SDK and Java SDK).
Click on the menu bar "File Project Structure" To check the SDK we loaded earlier:
Well, the Java SDK and the Android SDK are all loaded and we want the results. , click the "Project" tab to view the version of Gradle:
Iv. installation of the Genymotion simulator:
1, the installation of genymotion:
Genymotion is undoubtedly the fastest and best simulator available. Official website: http://www.genymotion.cn/
The simplest way to register, then download, and install VirtualBox is to download the Genymotion package that contains the VirtualBox, as shown in:
When the download is complete, start the installation. Then run the Genymotion software, you will be prompted to create a virtual device, click the Yes button to start creating a virtual device:
Connect using a previously registered account:
Then select one of the versions of the emulator:
In this way, our simulator is built, and then the emulator and Android studio are connected.
2. Associate Simulator Genymotion with Android Studio:
First download the plugin on Genymotion's website:
Then, open Android Studio, select the menu bar "File---settings", the following interface appears, and select plugins:
, select "Install plugin from disk" to load the plug-in from the local, pop up the following interface:
, select the plugin that we downloaded earlier to load. In this way, we can see more of a genymotion plugin in the plugin list:
Restart the software and let the newly loaded plugin take effect. After restarting the software Android Studio, select the menu bar "View--toolbar" and let the toolbar appear, and you can see that the toolbar has a Genymotion Device Manager icon:
Click on this icon to bring up the following screen:
, load our previously installed Genymotion folder. Then click on this icon to bring up the following screen:
, you can see the simulator that we've started up before:
Done.
Of course, if you want to run the program on the emulator, make sure the emulator is loaded with the Android SDK:
Next, run the program on the emulator:
, you can see that the version I compiled is API 20, but the emulator version is API 16, but the program is still running, which shows that Android studio does a good job with version compatibility issues. However, prior to using IntelliJ idea, you must require that the compiled version and the emulator (real machine) version be consistent.
V. Simple settings for Android Studio:
Subject modification:
Perhaps people will think the software interface is not very good, we can change the theme. Select the menu bar "File--settings--apperance--theme", the theme Select Darcula:
Code Font Modification:
Select the menu bar "File--settings--editor--colors&fonts--font":
The default scheme is not changed, click "Save as" to create a new name (e.g. MyFont):
, you can choose the font we want.
You can also modify the console font:
More tips on how to use Android Studio will be discussed in the future.
Build an Android integrated development environment using Android Studio (graphic tutorial)