Installation and Configuration of Android Studio (Windows)

This blog post is a very good article I found when configuring Android Studio. The author is very careful and the steps are very detailed.


Here is the source of this article:

Text/lampard_xu (author of the short book)
original link: http://www.jianshu.com/p/fc03942548cc

 

In fact, many people are stuck in the installation and configuration step. I think I was too. The evil XX firewall caused the download of Android Studio's gradle to be extremely slow. I remember that I was too slow to die at the time. . .

Without further ado, go to the official website to download Android Studio.

download

The official homepage gives the latest 0.86 beta version, that is, the installation version, which can be installed all the way. In fact, my personal suggestion is to use the green version, which is also convenient to upgrade in the future. Of course, it is super convenient to change the computer in the future. After decompressing it, open it and use it. The green version is also the same as chrome, divided into Canary version, Dev version, Beta version, but I still recommend using the Canary version. Why? Because even the Canary version is super stable, and I use this version for my personal work. It has been basically used for a few months, and it is much better than the previous version. Now the latest version is 0.8.10. Of course, it is also good to try some new functions.

The URL http://tools.android.com/recent is the place where google specifically publishes the Android Studio update log. I always pay attention to this, and only update Android Studio for the first time.

Friends, wake up, the green version does not have a built-in Android SDK, so you need to download the SDK yourself. Of course, if you use ADT, you can also go to the ADT directory and copy the SDK folder to Android Studio.

Official installation version download address
Official green version download address
Android SDK download address (green version needs to be downloaded, installation version is not required)

Green version and full version SDK collection version download address (link: http://pan.baidu.com/s/1mgG9EDM password: mc7x)

cache folder configuration

After the installation is complete, or the green version is decompressed, don't open Android Stduio in a hurry. Next, we need to configure the cache path of Android Studio. This cache file mainly stores some AndroidStudio settings and cache information of plug-ins and projects. The cache folder is as shown in the figure:

Why Android Stduio starts faster than Eclipse is also related to this cache folder. But the disadvantage is that it will be slower to build the cache for the first time.

Why configure this file? Because this cache folder is on disk by default, as your project grows, the cache will get bigger and bigger. It will even reach a size of several gigabytes, so it is necessary to move to a non-system disk, and it is also convenient for unnecessary migration when the system is reinstalled in the future.

Let's introduce the method of changing the cache path, find the root directory of Android Studio, enter bin, then find idea.properties, open and modify it, find the option to be modified, and remove the preceding #, that is, the comment symbol. Then fix the configuration path behind, the picture is what I changed

As shown in the figure, I changed the cache path to the root directory of the D drive, and the plug-in directory to the root directory of android studio, mainly for the convenience of packaging in the future.
There is also a reminder that since the path of windows is \and the path symbol of this configuration file is /, everyone should pay attention to the distinction.

The cache path has been changed. It's time to open Android Studio. Since I decompressed the green version to the D drive, it D:\android-studio\binlooks like this after I enter the following path.

Found studio.exe, since my system is 64-bit, I opened it studio64.exe. Of course, before opening, make sure that JDK has been installed in the computer and the environment variables have been configured. This is what it looks like after opening it.

.AndroidStudioBetaThe first option is to import the folder mentioned above that has been installed or used before, and the import can restore the configuration and project cache. If not, choose the second one. This is what it looks like after clicking OK.


The configuration of the build tool Gradle (also the most problematic place)

This part, which is the most critical part of the entire configuration process, is the configuration part of the Android Stduio build tool Gradle. If the configuration is not good, the project cannot be compiled and an error will be reported. It is also the most annoying part for beginners.

Before creating a new project, here are some conceptual differences between Android Studio and eclipse.

In Android Studio, there are some concepts that are different from eclipse. There will be many difficulties in migrating from eclipse to Android Studio. Of course, after clarifying the difference in concepts, it is easy to switch over.

Compare eclipse Android Studio
workspace workspace project
project project module
quote preference module dependency

To put it simply, android Stduio compares a project to modules of a project, and external dependencies are also modules, so the structure of a project is very clear.
Of course, there is also a disadvantage, that is, only one project can be opened in a window, and multiple projects cannot be opened in one window at a time like eclipse.

The science is over, now let's create a new project

Fill in the project name and path all the way to click next, and finally click finish to get it done

The key step is coming. Since Android Studio does not have its own Gradle plug-in, it will automatically download gradle, but you should also know how many people download it after a day because of the wall, and they are impatient or frequent errors. It also happened. Therefore, the first new project will generally be stuck in the place where the picture is.

Now I teach you how to configure the gradle file offline. First kill android Studio with the system's own process manager, then go to the C drive, find C:\Users\xxx\.gradle\wrapper\distsit, xxxand enter this directory as the username of the current system.

Find gradle-1.12-allthis folder, enter and you will see a 2apkk7d25miauqf1pdjp1bm0uobunch of strings of files, because this folder is randomly generated, so each person generates it differently, ignore him, click to enter this folder and you will see something like this

Leave it alone for now, go directly to the gradle official website to download, the 1.12 version of gradle, go to this website http://www.gradle.org/downloads Remember not to choose the 2.1 version (because android Studio does not support versions above 1.12), Select the version 1.12 according to the picture, select gradle-1.12-alland download.

If you can't get into this website or the download speed is very slow, here is the gradle download address of a network disk: link: http://pan.baidu.com/s/1hqCEb8g Password: ppb7

Remember not to decompress, just drop it directly into the file with a bunch of strings that was opened earlier. The folder will now look like this.

Then reopen Android Studio, the following situation appears, then congratulations, the configuration is finally successful.

The first build is a bit slow, please be patient, and it will be as follows after success.

Settings and Font Colors

Do you think white is too bright and blind, and the fonts and colors are too ugly? It doesn't matter. Next, I will teach you how to set it. Download the link
in my network disk : http://pan.baidu.com/s/1kT1I6V1 Password: 856q, import it as shown in the figure, and then restart.settings.jar

But there are still some places that are white, that is because the theme has not been modified. According to the picture, open the settings interface and select the cool black Darcula theme.

Then reboot again.

At this time, I found that the code font is very small, and opened the settings interface again.

Select sublimeMonoKai color matching, click ok, the effect is as shown in the figure.

The sublimeMonoKai color matching is a classic color matching on sublime Text. I like it very much, so I collected this color matching online.

The basic installation and configuration are basically completed here. Post a getting started guide for android Stduio: https://github.com/bxiaopeng/AndroidStudio

Finally, enjoy! Android Studio.



Text/lampard_xu (author of Jianshu)
original link: http://www.jianshu.com/p/fc03942548cc
The copyright belongs to the author, please contact the author for authorization, and mark "author of Jianshu".

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326863962&siteId=291194637