Android Studio-1.2 Version Setup tutorial

Source: Internet
Author: User

Google has updated the Android Studio 1.2 official version These two days, the new version of the settings interface big change surface, set the entry to the older version of the collation, not as long as the previous list.

Take advantage of the opportunity to install the new version, record the usual settings, put it in the blog to make a memo.

Android Studio/gradle Learning Resources

Before you say setup, learn about Android Studio and Gradle learning resources first.

Official tutorials
    • Developer.android.com on the android Studio Overview
      Http://developer.android.com/tools/studio/index.html
    • Build System Overview on developer.android.com
      Http://developer.android.com/sdk/installing/studio-build.html
    • tools.android.com Gradle Plugin User Guide * (Google out of Gradle guidelines)
      Http://tools.android.com/tech-docs/new-build-system/user-guide
    • IntelliJ idea Quick start (Idea starter tutorial)
      Https://www.jetbrains.com/idea/help/intellij-idea-quick-start-guide.html
    • IntelliJ idea's shortcut key encyclopedia
      Https://www.jetbrains.com/idea/docs/IntelliJIDEA_ReferenceCard_Mac.pdf
Unofficial resources
  • Developer Phil Blog  Android Studio Tips Series (a dynamic diagram with shortcut key effects on it, highly recommended)
    http://www.developerphil.com/android-studio-tips-tricks-moving-around/#recent-posts-4
  • Android-studio-tips-by-philippe-breault (seems to be the above, have not looked at, temporarily not sure is the same, or sent to the good)
    Https://github.com/pavlospt/Android-Studio-Tips-by-Philippe-Breault/wiki
  • Stormzhang Great God's Android Studio Series Tutorials (recommended)
    Http://stormzhang.com/posts.html#AndroidStudio
  • Rinvay Tang 's Blog
    (Gradle Plugin User Guide translation, "Using Gradle to build Android program") (recommended)
    Http://rinvay.github.io/archive.html
  • Gradle Android Plugin User Guide translator (another translated version of the Gradle Plugin User guide)
    http://avatarqing.github.io/Gradle-Plugin-User-Guide-Chinese-Verision/
  • "Android Studio" on GitHub (lots of good things are inside)
    Https://github.com/search?utf8=%E2%9C%93&q=Android+Studio
Environment Construction RelatedDownload

The official version of Android studio and SDK can be downloaded at the link below

Http://developer.android.com/sdk/index.html#Other

For download, I recommend downloading the green version of Android studio and SDK, do not install the package version of the bundle version, so that if there is a problem to reinstall, just move one.

Other versions can be found here http://tools.android.com/download/studio/canary

Disable in Windows Ctrl+space Shortcut keys for switching input methods

Windows Ctrl+space shortcut keys (toggle Chinese input) conflict with a bunch of Ides, so you must disable them and modify the registry as you like.

or download my modified Registry file ( right-click Save As ), double-click Import files inside the package, restart the system.

Principle Reference here .

Environment variables

Many Ides rely on environment variables to properly set environment variables, to ensure that the software works properly, and to avoid a lot of strange problems.

To set the environment variable method, please search by yourself. The following environment variable values are my own computer, please follow the actual situation to modify.

Also have PATH to pay special attention, to add to the back of the original, do not cover all the forehead.

Java
Java_home=e:\devtools\others\java\jdk1. 7.0_67 Classpath=.; %java_home %\Lib; %java_home %\ # Note that%path% is the original environment variable value, adding ";" And the back of the content to the original value after path=%path%; %java_home %\bin; %java_home %\Jre\bin
Android SDK
Android_home=e:\devtools\android\sdkpath=%path%; %android_home %\tools; %android_home %\ # adb port, you can avoid a bunch of software in China, such as cool dog music what the ADB port preemption, the value of a random change is not used on the line android_adb_server_port=7123
Gradle
# Android Studio has a built-in Gradle after the official version, of course you can also go to gradle official website to download a gradle_home=e:\devtools\android\android-studio\gradle\gradle-2.2. 1\binpath=%path%; %gradle_home %\ # rely on warehouse storage path, usually build the project when the download of the dependent libraries are placed here # If not configured, the default in Windows is C:\users\<username>\.gradle # Reinstall the system when you forget to back up, and do not want to re-download dependencies, then quickly changed this place Gradle_user_home=e:\devworks\.gradle
Run the configuration before Android studioConfigure SDK Manager Science online, upgrade SDK

Recently, red Apricot out of the public service agent, is simply the gospel of developers, see more: http://blog.honx.in/dev-only/

According to Red Apricot provide address and port (currently hx.gy:1080 ) to modify (Biega / http), if necessary, you can click the "Clear Cache."

If you have the conditions, you can try to buy a paid shadowsocks, I am now shadowsocks.com the 99-pack annual package.

Telecom 8M, part of the line can reach more than 900 kb/s speed, almost full speed, feel OK.

Specific how to purchase and configuration, not in the scope of this article, please find science for yourself.

If you want to buy, please be sure to use my promotional link, I have a commission. Laugh

About downloads, Tools in the Android SDK build-tools recommended all download,

Other API versions, it is recommended to download at Least SDK Platform (must, the framework layer is all here ) and Sources for Android SDK (source code) ,

Android Support Repository must be downloaded in Extras and Android support Libraries (Support library, the development of the support library is now inseparable),

The above mentioned is the development must use, other things to see the situation, you have time and do not care about the use of resources, full download is OK.

By the way attached I downloaded myself , poke this connection to view.

Modify the Idea.properties file

Locate <android-studio>\bin\idea.properties file, open it, and change it to this:

# Disable the first time you run Android Studio, automatically check and upgrade Android SDK disable.android.first.run=true# below two are Android Studio settings, plugins, and other files that are generated by the runtime are stored in the directory #, which is c:\users\<username>\ in Windows by default. Androidstudio.2\ inside # ${idea.home.path} represents the home directory of the Android Studio program, note that the directory delimiter should use a forward slash "/" idea.config.path=${ Idea.home.path}/. Androidstudio.2/configidea.system.path=${idea.home.path}/. Androidstudio.2/system

The very pit daddy is, every time the Android studio upgrade, will be forced to detect if the files or folders inside the as home directory is passive,

And of course it contains this idea.properties,

Some enhanced templates or plug-ins, such as this androidstudiotemplate, require <android-studio>\plugins\android\lib\ to be overwritten during installation Templates .

If the discovery is changed, it will require

Processing

(restore default) operation, for example, idea.properties and that templates will be reverted to the appearance of decompression, all kinds of changes will be invalidated.

So the insurance, the idea.properties file after the backup, after upgrading as, the manual change back, a variety of plugins/templates also save a backup, do not install after the deletion, lest be as the upgrade program deleted after not to find back.

Set up Android Studio

The point came, after running, into the welcome interface, do not rush to build projects , first Configure → settings to modify the settings.

IDE Appearance & BehaviorModify the theme, modify the global font

    1. Change theme, want to use cool dark theme, change to darcula bar;
      Font, choose a with Chinese, or there will be a lot of mouth , I here with the Microsoft yahei UI, very good.
    2. Enable/Disable animation effects, disabling the feeling may be faster.
Disable automatic opening of last project

I like to choose which project to open, decisively disable

Set up a network proxy

As above, change to the Red Apricot charity agent.

Disable automatic check for updates

The choice of cleanliness, upgrade control please ignore

Configure shortcut keys

No matter you change, anyway I did not change, the default is good, lest later check data, operation is not on

EditorHover over a document, Format & Guide Tips

    1. The mouse pointer hovers over a number of times, displays the document, and time changes itself.
    2. is the format code or the guide package, whether it will show a dialog box, feel annoying, all cancel it, anyway I canceled.
Show line numbers, Show method divider lines

Hook it up, you deserve it.

Code Folding

Intellij idea has a lot of local code can be automatically folded, but I hate, so canceled, here a matter of opinion, look at the

p.s. Ctrl +. You can collapse and expand code

Code Intelligence Tips

    1. Knock what character will prompt, all (case all match), None (regardless of the case, match on the hint), (first letter) (one character conforms to OK, other casual). My brain is not memory of course choose none.
    2. Automatically pops up the document, time to look at the office.
    3. Automatic pop-up method parameter hint, time to look at the office.
Automatic Guide Package

    • Optimize imports on the fly: Optimization of the Guide package, the format code will delete the excess guide.
    • Add unambiguous imports on the fly: Tapping the simple class name on the code will help you guide the package.
Create a personal code style configuration

The estimate is to protect the default code-style configuration, so that the user can make the configuration bad or one-click Restore, Idea does not allow the modification of the default configuration, requires the user to create the configuration to be modified.

Choose which theme is based on, and Save as a copy.

modifying code Fonts

Highly recommended with consolas font, good looking!!!

modifying console Fonts

All right, I just love the font.

Logcat fonts

If you want to change, you have to cancel 1 of that place first.

Modify the comment location to disable the statement heap row

    • Comment at Frist column: If enabled, the annotation symbol will be at the beginning of the line, otherwise it will be indented in the comments. I canceled it.
    • Control statement in one line: When formatting the code, it merges a few short statements into one row. I think this affects the readability of the code, it is canceled.
Modifying a variable prefix

Static member is S, ordinary member is M, kinda meaning

Modify new file Header

Each time a new class is built, the following note must be familiar.

/** * Created by Licheetec on 2015/5/2. */

is the universal file header, the box is the user name of your system, you want to personalize the words, you can change here, as to where to refer to the head of the file, just in the next room.

Modify file Encoding to UTF-8

Do not pit teammates, small friends are unified to UTF-8 bar.

Experience EnhancementsEnhanced Live Templates ( Ctrl+j Smart tips Template)

The default live templates is not enough, not even foreach, fortunately, the great God on GitHub made an enhanced template, decisive to use.

Idea-live-templates: https://github.com/keyboardsurfer/idea-live-templates

After downloading the file, locate the following directory:

<android-studio>\. Androidstudio.2\config\templates ,

As to why this is the directory, trouble forward to Modify the idea.properties file ,

If there is no templates folder, you can manually build one.

Get all the *.xml files into that folder and reopen Android Studio to see the effect.

foreach has a setting to change, otherwise for ($i $: $data $) { will be automatically formatted as multiple lines.

Here is a demo of The dynamic diagram of the foreach and FBC

おわり

Fix, Android Studio Basic Setup tutorial for the time being, there are new things to update later, other compilation system related to the temporary not to feel very clear, do not fraught. can be tired.

Android Studio-1.2 Version Setup tutorial

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.