Android Studio Installation Configuration detailed steps, and basic actions to use

Source: Internet
Author: User
Tags version control system


Maybe everyone is not very familiar with Android studio, is Google's new development tool for Android development, many open-source projects are already in use, Google's update speed is very fast, it is obvious that this is the future of Android development, So what reason do we have not to embrace the future?

This article is for a basic summary of this period I was using Android studio, including first-time installation and configuration. As I am also the same as the GF Android developers, has been using the ECLIPSE+ADT+SDK environment, has been accustomed to the original way, may not like to receive this fresh tool, but before the online said ADT is no longer updated, after the face of the update so fast Android SDK What should we do? Although this is not necessarily true, but even if not innovative technology but at least to keep up with the new technology, so it is interesting to use, this article as a summary, but also to share.

The following are basic uses for Android studio installation, configuration, and creation of projects, theme font replacements, window tools, layouts, shortcuts, and more.

(Prerequisites, the JDK is properly installed, and its environment variables are configured, i.e. under the Java Development environment)


I. Android SDK Download and installation

if a suitable version of the Android SDK is already available locally, you do not need to download it, or you can update the SDK with SDK Manager;

If there is no SKD, you need to download, in fact, during the installation of Android Studio will choose to download the latest SDK installation, but very slow, I am accustomed to download the SDK, after installing Android studio after the configuration (of course, this is my personal habits, You can install the SDK directly in the process of installing Android Studio.

Let's say here. Download/Update SDK using SDK Manager:

(1) If the SDK Manager is not installed, can download the installation, address Https://github.com/inferjay/AndroidDevTools#sdk-tools, download complete, directly run the installation can be, The JDK in the native environment will be automatically matched during the installation process and into the installation directory:

(2) Launch SDK Manager.exe, such as:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/78/C9/wKiom1aDWNvyaJhzAAEOOZu8IqY356.png "title=" Sdkmanager.png "alt=" Wkiom1adwnvyajhzaaeoozu8iqy356.png "/>

(3) Update time is longer, also may not update, you need to be equipped with an agent.


two. Download and install Android Studio, as well as new engineering and commissioning operations

because the official website address Http://tools.android.com/download/studio can not download, so I direct Baidu search download (not very know can, anyway with the line).

In addition, provide a domestic mirror https://github.com/inferjay/AndroidDevTools

After the download, if the installation package, you can install directly, if it is unpacked, you can unzip, directly run (studio.exe file in the installation directory).

During the installation process, because the SDK has been downloaded before, so skip the SDK installation, always next know finish, run open Android Studio, then manually configure the SDK, click SDK Manager, configure the path of the downloaded SDK, such as:

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/78/CE/wKiom1aDgvHAVpzEAAGIIZsx37Y178.png "style=" float: none; "title=" Sdk.png "alt=" Wkiom1adgvhavpzeaagiizsx37y178.png "/>

After configuring the SDK, you can create a new project, such as the following series of diagrams:

(1) file-->new-->new Project:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/78/CC/wKiom1aDd8PA71jsAAEFKQiwU5M904.png "style=" float: none; "title=" New.png "alt=" Wkiom1add8pa71jsaaefkqiwu5m904.png "/>

(2) Next--> can choose the version of the project created--if you do not know the version, you can click help me choose:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/78/CA/wKioL1aDd-DCIS2_AAFCnes5kVs805.png "style=" float: none; "title=" New2.png "alt=" Wkiol1add-dcis2_aafcnes5kvs805.png "/>

(3) Click Help me choose to display the current version of Android system Information, what is not clear! (It's great to just look at the interface UI)

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/78/CC/wKiom1aDd8STeW0eAAEY5arf2FU870.png "style=" float: none; "title=" New3.png "alt=" Wkiom1add8stew0eaaey5arf2fu870.png "/>

(4) After selecting the version next--> go to select the main activity style interface, here are just a few, style a lot:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/78/CA/wKioL1aDd-LQGORiAAE6G36Vhns958.png "style=" float: none; "title=" New4.png "alt=" Wkiol1add-lqgoriaae6g36vhns958.png "/>

(5) Continue to next--> until finish, then completed the creation of the project, the creation process will be a little longer, need to wait (spit groove A company with the computer, configuration super poor, minutes want to smash off!!) )

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/78/CA/wKioL1aDd-OCQUr1AAB4zRYqBA4511.png "style=" float: none; "title=" New5.png "alt=" Wkiol1add-ocqur1aab4zryqba4511.png "/>

(6) The following is the completion of the project interface, click on the toolbar above the running icon to run, the following logcat in the log information, these and eclipse almost, use will be very handy, will not be too much to explain.

This article describes in detail the different places and unique advantages of Android studio that are common to eclipse.

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/78/CA/wKioL1aDenyh7KEhAAGhKPgqsKQ139.png "title=" New0.png "alt=" Wkiol1adenyh7kehaaghkpgqskq139.png "/>


Three. The engineering directory structure of Android Studio

When we create a new project, the directory structure defaults to this:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/78/CA/wKioL1aDe72iwg9kAAESdV7JG7w265.png "title=" New6.png "alt=" Wkiol1ade72iwg9kaaesdv7jg7w265.png "/>

You can see that the directory structure of Eclipse is very different, Android studio can only have one project, and Eclipse can have a lot of projects at the same time, if you look not accustomed to click on the upper left corner of the Android robot to switch:

After switching "Android" to "Project", as follows:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/78/CB/wKioL1aDfX-DSLhxAACXpu6YZ-Q596.png "title=" New7.png "alt=" Wkiol1adfx-dslhxaacxpu6yz-q596.png "/>

It feels like the structure in eclipse.

In general, the differences with eclipse are as follows:

1. There is a concept of project and module in Android Studio, which says that a window in Android Studio can only have one project, Represents a workspace, but a project can contain multiple module, such as the Android library that your project references, the Java library, and so on, which can be regarded as a module;

2, the above directory of Java code and resource files (Pictures, layout files, etc.) all boil down to src, in the SRC directory has a main group, while dividing the Java and res two folders, The Java folder is equivalent to the SRC folder under Eclipse , and the RES directory structure is the same.

About the engineering directory structure as long as you use the habit, do not have to say too much, next to the other uses of Android Studio.

3. Main files and directories:

(1) Settings.gradle: Each moudle to register here, you can open the file to see it will understand;

(2) Build.gradle: Configuration for each project

(3) App: each module

(4) App/build.gradle: Each module configuration file, such as a dependent class library, SDK version

(5) app/src/: Source code and resource files are here; The documents we write are all in this area.

(6) app/libs/: Add Class Library.


Four. Basic use ofAndroid Studio

I used Android Studio to feel good, because there are many places to use than eclipse convenient, with very handy, look at the following:

1.Android Studio does not have to be saved manually, he has the function of automatic saving;

2. The "TODO" view shows the position of the current program very well;

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/78/CB/wKioL1aDf9PT9npDAADu_GQrwHk931.png "style=" float: none; "title=" New8.png "alt=" Wkiol1adf9pt9npdaadu_gqrwhk931.png "/>

3.Android Monitor view has logcat, memory and other interface, about Logcat is also very convenient to use;

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/78/CD/wKiom1aDf7fzKiiPAAESwE2Tnnw845.png "style=" float: none; "title=" New9.png "alt=" Wkiom1adf7fzkiipaaeswe2tnnw845.png "/>

4. Compared to eclipse,Android Studio has a very unique place to count its own "Terminal", for Android developers this is more convenient than opening a cmd, especially easy to use;

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/78/CB/wKioL1aDf9SzIc7rAADD-CiQYaA325.png "style=" float: none; "title=" New10.png "alt=" Wkiol1adf9szic7raadd-ciqyaa325.png "/>

5. There are several common features on the right side of the studio menu bar, namely gradle sync ,AVD manager,SDK manager,DDMS:

(1)Gradle synchronization When you run the project or change the Gradle configuration, you have to click this button, will download the corresponding dependency

(2)AVD Manager simulator Manager

(3)SDK Manager is your SDK version

(4)DDMS is Dalvik Debug Monitor Service,dalvik Debug monitoring service.

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/78/CB/wKioL1aDf9bC7kJuAABUkZ8_xyE740.png "style=" float: none; "title=" Tool1.png "alt=" Wkiol1adf9bc7kjuaabukz8_xye740.png "/>



Five. Common shortcuts for Android Studio


global shortcut key (more important)
eclipse shortcut keys br>
alt + ENTER Engineering quick fix ctrl+ 1
ctrl + SHIFT + A Quick Find
ctrl + ALT + L
format code ctrl+ I
ctrl + Q
View document mouse auto
shift + ESC when switching to a non-editable region, close the area and return to the edit area
Edit Area shortcut keys

CTRL + B/F4

Or This CTRL + click (applicable)

View Source
ALT + INSERT Insert method (construction method, Get Set method, and so on), in the 工程结构 new file


Atrl +/ Contextual associations
ALT + left/right Switch between different documents
ALT + Top/bottom Jump to previous/next method
Comments
CTRL +/ To gaze upon the way forward
CTRL + SHIFT +/ Document Gaze
copy/paste
eclipse
Ctrl + C Copy the line
CTRL + V paste
CTRL + X cut
CTRL + Y Delete the line ctrl + D
Find
Ctrl+shift+a Find all Behaviors
Ctrl + F Find the currently edited document
Ctrl + R Find and replace
Ctrl + N Find classes (Class)
Ctrl + SHIFT + N Find Files


Six. Android Studio VS Eclipse

Believe that the current domestic use of eclipse is still the majority, then first of all, a few of the advantages of studio, compared to more convincing, to explain why we are migrating from Eclipse to studio.

1, Google launched the

Without a doubt, this is its biggest advantage, Android Stuido is launched by Google, specifically for Android "tailor-made", Google is strongly supported by a IntelliJ idea to transform the IDE, This should be able to explain why it's the future of Android.

2, Faster

Eclipse startup speed, response speed, memory consumption has been criticized, I believe you should have a deep understanding of this, and often encounter a card-dead state. Studio is a leader in all aspects of eclipse

3. More Beautiful UI

The black theme I am demonstrating on I/O is fantastic, geek, Stuido's Darcula theme's Cool black interface is really tall, compared to eclipse black theme is too low

4, more intelligent

Tip completion is significant for development, and studio is smarter, intelligently saved, and never has to be Ctrl + s every time. The efficiency will be greatly improved when you are familiar with studio.

5. Integration of Gradle Building tools

Gradle is a new build tool that supports Gradle from studio debut, and can be said to gradle a collection of the benefits of Ant and Maven, both in configuration, compilation, and packaging.

6. Powerful UI Editor

Android Studio's editor is very smart, in addition to absorbing the advantages of Eclipse+adt, but also comes with a multi-device real-time preview, relative to the Android developers is an artifact ah.

7. Built-in terminal

Studio built-in terminal, which is the gospel for people who are accustomed to command-line operations, no longer has to switch back and forth, and a studio is all done.

8. More perfect plug-in system

Studio supports a variety of plugins, such as Git, Markdown, gradle and so on, what you want plug-ins, direct search for downloads.

9. Perfect integrated version control system

The installation comes with a popular version control system such as GitHub, Git, SVN, and can be directly check out your project.


Seven. Switch Android project to Android Studio

Google has given two solutions to the solution.

First Kind

Select the directory directly, next until finally, our Eclipse project is on Android Studio, and it's important to note that such imported projects will still preserve the way eclipse is built, such as when we use ant build on Eclipse, It will still be built with ant after the migration.

The second Kind

First, we export the project as a Gradle project in Eclipse.

650) this.width=650; "class=" Imagebubble-image "src=" http://ww1.sinaimg.cn/large/ 68622377gw1et3lme261sj209q0ajmyw.jpg "alt=" Select Export "/>

Select Export

650) this.width=650; "class=" Imagebubble-image "src=" http://ww4.sinaimg.cn/large/ 68622377gw1et3lmdqdx5j20el07djs8.jpg "alt=" Export Gradle project "/>

Export Gradle Project

Then open Build.grade directly in Android Studio.
In this way, the project becomes a Gradle build.


Everyone read the above is not very tempted, the advantages are many, but we will encounter a lot of problems when learning, such as the directory structure of Studio and Eclipse, shortcut keys and so on completely different, need to adapt to a period of time, Gradle also increased the learning cost, While Google's update is fast, the studio official explains that the NDK is not supported, so if your project uses the NDK, it's best not to use studio.

But I believe that Google will be more and more perfect, learning cost and adaptation stage is our technology has to maintain the mentality, once you start to believe that you can not leave it.



This article is from "MySpace" blog, please make sure to keep this source http://wangzhaoli.blog.51cto.com/7607113/1730011

Android Studio Installation Configuration detailed steps, and basic actions to use

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.