Android Studio Getting Started Guide

Source: Internet
Author: User
Tags android sdk manager

Reproduced:

Original link: http://www.codeceo.com/article/android-studio-guide.html

Write in front

As an Android developer, you should be very familiar with Android studio, if you don't understand now, it doesn't matter, then from now on, let's Learn more about Andoid studio.

Android SDK Installation

Official download: SDK tools–android Developer
Domestic Image: SDK Tools–androiddevtools

With SDK Tools You can configure it to install the Andrid SDK and open the Android SDK Manager

Open SDK Manager, if there is a proxy or VPN can be downloaded directly, generally check the TOOLS,EXTRAS;SDK version does not have to update all. Because the domestic connection speed is very slow, you can refer to this article to use the domestic image to download.

Android Studio Download and install

Download

Before you download, make sure you have the JDK and Android SDK installed.
Because the domestic can not download directly, so I am here to provide two ways to download, one is the official website, the other is a domestic mirror site.

    • Official website Download: Android Studio Download

    • Domestic Mirror: Androiddevtools–github

Installation

After downloading, if it is the installation package, can be installed directly, if the decompression package, can be decompressed, directly run.

    • Windows runs the installation directory/studio.exe file.

    • Mac/linux Run the installation directory/bin/studio.sh.

Once opened, the Settings page is entered, and if the SDK is not installed, select Standard. If you have already installed the SDK, select Custom, and then select the SDK installation directory.

Then just keep next.

Installation and configuration of the Gradle

Since Android Studio is built by default using Gradle, and Gradle's access to the country is bizarre and slow, we installed it ourselves.

    • Official Download Gradle:gradle–download

    • Domestic download Gradle:gradle–androiddevtools

Detailed installation: Gradle Install Guide (installation instructions) · Issue #11 · Tikitoo/blog

Build your first Android program using Android Studio

It is said that the first time to create a project, will be stuck there, there is a solution that Daniel found, is to configure the offline Gradle, because we have downloaded the above gradle, can be directly used.

Can put Gradle-2.1-all.zip (do not pressure)

Windows is placed in C:\Users\xxx\.gradle\wrapper\dists\ ... Directory ().

Mac/linux put in ~/.gradle\wrapper\dists\ ....

Then create project again and it won't get stuck.

The role of a directory file for an Android project

After a project is created, the approximate file directory is like this.
Because each project in Android Studio is equivalent to Eclipse's workspace, each module (app directory) corresponds to Eclipse's project.

    • Settings.gradle: Each moudle to be registered here

    • Build.gradle: Configuration for each project

    • App: Each module

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

    • app/src/: Source and resource files are here; we write all the files here.

    • app/libs/: Add Class Library.

Engineering and document structure
    1. File editing area

    2. Edit area to the left (line number displayed)

    3. Enter the prompt area

    4. Document Switching Area

      • ALT + left or ALT + right, different tab toggle

      • Ctrl + Tab: Toggle between different areas

    5. Other functional areas

New file or Insert method
ALT + INSERT (COMMAND + N Mac)

    • In the editing area is the insertion method (construction method, Get Set method, etc.);

    • Create a new file in the engineering structure

List some common shortcut keys
global shortcut keys (more important)  
ALT + ENTER Engineering Quick Fix
CTRL + SHIFT + A Quick Find
CTRL + ALT + L (Win) Format code (My lock screen shortcut key is accounted for)
CTRL + Q (Win) View Documents
SHIFT + ESC When the non-editing area is toggled, close the area and return to the editing area

edit area shortcut keys  
CTRL + B/F4 View Source
CTRL + Q View Documents
SHIFT + ESC When the non-editing area is toggled, close the area and return to the editing area
Atrl +/ Contextual associations
ALT + left/right Switch between different documents
ALT + Top/bottom Jump to previous/next method

Notes  
CTRL +/ To gaze upon the way forward
CTRL + SHIFT +/ Document Gaze

Copy/Paste  
CTRL + C Copy the row
CTRL + V Paste
CTRL + X Shear
CTRL + Y Delete the row

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

Git uses

Since Android Studio has its own git plugin, we don't need to download it, just download the GIT installation on this machine.
Then configure the executable file in Android Studio.

Original link: http://www.codeceo.com/article/android-studio-guide.html

Android Studio Getting Started Guide

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.