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.
Installation
After downloading, if it is the installation package, can be installed directly, if the decompression package, can be decompressed, directly run.
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.
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
File editing area
Edit area to the left (line number displayed)
Enter the prompt area
Document Switching Area
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