Android Development tools full turn to Android Studio (1)--Prepare for development environment

Source: Internet
Author: User

工欲善其事 its prerequisite, this article is suitable for Android novice and the use of Eclipse and not used Android studio to develop Android, it is known that Google will no longer maintain and develop ADT, the old ADT has been completely unable to render Android 6.0 UI layout, yards farmers must adapt to the times to quickly turn as.

Note: The following is based on the Windows platform, as the current stable version of the 1.4.1. For the sake of simplicity, the following uses "as" instead of the Android studio description Word.

First, the normal use as for the development of the necessary software environment: an operating system (Windows, OSX or Linux), JDK, SDK and as itself, optional software environment: NDK

Second, prepare the software environment

1, operating system installation (slightly, not within the theme)

2. Install the JDK and configure the environment variables (slightly, not within the topic)

3, install the SDK and as, start as:

① to https://developer.android.com/sdk/index.html separately download SDK and as (No SDK tools Included version) or download the Windows version of the Integration SDK as (recommended version)

② after installation, first open select the second one

③ then the configuration SDK prompt may appear (download as non-recommended version will be prompted), all choose to cancel ignore (if not turned Qiang, will never be successful download), etc Unified Configuration

④ first Open will also stuck here, because you did not turn Qiang, connect to Google Server, the solution is to force the shutdown as, and then into the as installation directory (for example, I am: D:\Program files\android\android Studio)-- Locate the Idea.properties file in the Bin directory--Open the Idea.properties file with Notepad--add disable.android.first.run=true--Save at the end and rerun as

⑤ again opened into the main interface as, when the first thing to do is not to create a new project, but to do some common configuration, and the export of these configurations for the next time to change the computer, re-installed system can quickly import configuration

4. Configure as: Enter as setting interface (step: as Main interface--configure--settings). In order to facilitate the following with the "as set interface" description Word: As the main interface--configure--settings interface

① Configuration SDK (downloaded as non-recommended version only needs to be configured):

Enter: As Settings interface--appearance & Behavior--system settings--android SDK, click Edit to select the SDK path and confirm

② configuration jdk (normal JDK is not required, unless you do not have the JAVA_HOME environment variable) and NDK (optional):

Enter: As main interface--configure--project Defaults--project STRUCTURE--SDK location, although this interface name is the SDK location, actually support the JDK and NDK configuration. But there's a good chance that the NDK option button is not available, Perhaps the lack of any configuration or AS1.4.1 version is not smart enough, if you have a good network, and did not download, so long click the download button slowly download, but if the local and have now the NDK that selection button is not selectable, how to do, there is a trick, I am testing the compilation of Facebook fresco is feasible , but now the interface is not up to that step, the first solution: the SDK location interface does not have to set it, first to the system environment variable configuration ndk_home-- You can compile the module with the NDK by adding Ndk.path (for example: ndk.path=f:\\android-ndk-r10e) at the end of the gradle.properties file that needs to be used in the NDK's module.

③ configuration file encoding (recommended for all UTF-8):

Enter: As Settings interface--editor--file encoding--ide encoding/project encoding/default Encoding for properties files--all set to UTF-8

④ Configuring as overall theme (I like Darcula):

Access: As Settings interface--appearance & Behavior--appearance--ui Options--threme

⑤ Configuring Eclipse Shortcuts (required for developers to turn to eclipse): Enter: As Settings interface--keymap--eclipse, after this choice can only say that most of the keys are the same as the eclipse, in fact, there is still a small part is not the same, The different keys are listed below and how to set the same

-Set alt+/as Quick prompt shortcut key: As setting interface--keymap--search complete--code--completion--basic--to alt+/

TODO more to discover supplement

⑥ other keys, mouse, display and other optimization settings:

-Set the mouse to show comments: As setting interface--editor--general--other--show quick doc on mouse move--selected

-format can be formatted automatically note: As Settings interface--editor--code style--java--wrapping and Braces--keep when reformatting--comment at first column --Uncheck

-Set all project files to show line number: As setting interface--editor--general--appearance--show lines numbers--selected

-Set Auto Import Package/class: As setting interface--editor--general--autoimport--java--all selected

-Format code line width: As Settings interface--editor--code Style (checked)--right margin (columns)--120 (as default is 100, personal feel write Java code using 120 ideal)

-Modify Class Comment Template: As settings interface--editor--file and Code templates--includes--file Header, I like to use the following comment module to replace the original system template:

/**
* @author ${user} (Andy)
* @datetime ${year}-${month}-${day} ${hour}:${minute} gmt+8
* @email 411086563@qq.com
*/

-Open Memory Status display: As setting interface--appearance & Behavior--appearance--show memory indicator--selected

-Turn on Compile optimization: As Settings interface--build,execution,deployment--compiler--make Project automatically--selected

-android Lint settings: As settings interface--editor--inspections--android lint--According to the needs of the settings (normal is not required settings, special such as Android native Launcher3 source code does not set may not be compiled through, This can be done by lowering the check security to let the compilation pass)

TODO more to discover supplement

⑦ If you feel OK with the relevant settings in the as settings interface above, then export these settings (to be sure, the backup settings, the next time you reload the system, reload as, change Ubuntu or OSX, you don't have to set it up again, import the settings directly):

-Export the Code style settings separately, as long as you have customized your style, for example I am customizing it here:

Enter: As main interface--configure--export settings--only select the code Style, click OK, if it is team development, the Director can send this exported file to all group members with as import (import later), This will keep the code style consistent across the team.

-Import all profiles, this is more suitable for individuals, because the theme, font size and other settings, and not necessarily suitable for the entire team of all (in fact, the import can also be selected, the following), as the main interface--configure--export Settings--select All, you can export

⑧ import settings, follow the export, enter: As the main interface--configure--import settings--Select the backup export file. Import can be selective import, if you do not want someone else's code style is not checked

⑨ next to solve the problem is that the network problem (that is, to find ways to turn Qiang) (Google can not see this article):

Turn Qiang can use the Qiang tool, or use the proxy settings. Turn Qiang tool does not introduce, run turn Qiang tool represents has turned Qiang success, turn Qiang tool recommended Pgfast, is also currently I use one. The following is the setting agent to turn Qiang.

Set proxy for as: Enter: As Settings interface--appearance & Behavior--system settings--http Proxy, fill in the information about the agent server

Set agent for SDK Manager: Enter: As Settings interface--appearance & Behavior--system settings--android sdk--launch Standalone SDK Manager

Then select options in the SDK Manager

Enter the relevant proxy information, which completes the SDK proxy settings

All of the above have been done, all ready only owed to the east wind to concentrate on the development projects, follow-up will be written down as new projects, module, import Eclipse Project, module crud, Lib module reference, Gradle Configuration and considerations of these operations, Problems that may be encountered.

Original essays, reproduced annotated source.

Android Development tools full turn to Android Studio (1)--Prepare for development environment

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.