Android Development Self-study note (based on Android Studio1.3.1)-1. Environment Construction (turn)

Source: Internet
Author: User
Tags version control system

First, Introduction

The development environment for this set of learning notes is the latest version of 1.3.1 for Windows 10 Pro and Android Studio.

Android Studio is an Android development environment based on IntelliJ idea. Similar to Eclipse adt,android Studio provides integrated Android development tools for development and debugging.

I didn't use Eclipse to do Android learning, but based on Android Studio's project architecture similar to VS, or the IDE for Android studio, there's no other reason.

Here is a comparison of some of the network-found advantages of the Ecplise,as (Android studio abbreviation):

    • 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.

Click to view Source

From the above point of view, is it said or some abstract? But the almighty netizen in the original comments also gives a more specific advantages, here to borrow, to show you:

1. Ultra-strong code completion, strong refactoring capabilities (supporting XML-related renaming, automatic quick positioning in XML and Java files), strong code analysis (NPE and other Code FAQ analysis)
Code completion, refactoring, and Code analysis. (IntelliJ the idea feature)
2. Multi-screen design-time support
3. more flexible build system based on Gradle, with flexible build variable can easily realize multi-channel, multi-product line, multi-package name packaging and other functions
4.layout edit page to instantly preview
5.when debugging, you can browse the picture
6. edit mode, when referring to the picture, color and other resources, the preview is displayed on the right side of the thumbnail, when referring to the text, the resource ID is automatically collapsed, displayed as the text will be displayed
7. use Gradle to manage dependencies and facilitate reference and upgrade of third-party libraries
8. can automatically decompile dependent jar or class file (IntelliJ idea attribute)

But the shortcomings are particularly obvious, because the use of gradle construction, in view of the domestic network environment, if there is no network will be more tangled, as (Android studio no longer explained) is too dependent on the network.

Two sites for learning Android Studio:

1.Android Studio Chinese Community

Update is slow, now for a long time no update content, website address can own Baidu.

2.AndroidDevTools

This site updates more timely, content is also rich, click to view

Now the version of as has been updated to 1.3.1, the use has been completely no problem, as is based on Gradle built, Gradle is based on the Groovy language, oriented to Java applications. Automated building tools based on DSL (domain-specific language) syntax. More detailed information about Gradle please Baidu or Google, Gradle's official address: Click to view

The Android environment configuration is mainly divided into two parts, one is the IDE tool download and installation and the SDK download and configuration.

Unfortunately, like Goojje, as the official website is also the great TC wall, and I do not want to FQ classmates, can visit the Android Devtools website to download the latest version of the As tool, the latest version is 1.3.1, such as:

This site also provides a very full tool, here I also put a few pictures for your reference:

The next few items are no longer the same, interested in the self-check.

Second, Android Studio1.3.1 installation and configuration

Here we go back to the download of AS, click on the Windows version, here is pointing to the Baidu network disk:

The first is the compressed package, the green version, no installation, after decompression can be run.

The second one is the installation version.

The third one contains the installation version of the SDK.

I have chosen to download the installation version because I have already done my own job with the SDK. Installation steps I directly on:

Note: The performance part is that if you have an Intel-enabled processor and can choose to download virtualization, you can use X86 virtual machines faster.

Note: If you do not have the option to install HAXM, you will not be able to set the maximum memory footprint for X86 VMs.

Here is the wait to finish. Park has a friend wrote as using the Visual Studio Android Simulator Tutorial (has been tested, no success, see comment said debugging process is also more troublesome, then give up using),

I am more interested in this because I have heard that the SDK simulator speed is unsatisfactory.

Friends of the article link in this: Click to see the users who want to use this simulator can go to see their own ways.

It is necessary to note that if the emulator using the SDK is creating a X86 image,

If your machine supports virtualization, but always call unsuccessful, remember to check the control Panel-software-Add remove Windows features, the Hyper-V removed, this is also a toss me a long time to solve.

But if you use the VisualStudio Simulator, remember to select Hyper-V, which means the two are conflicting.

End of installation

If you install an older version of AS, you can choose the first IDE environment configuration before importing.

Here I choose the new configuration.

First run, it checks the system environment by default. The speed is not very fast ....

First: Standard style, import default configuration items

Second item: Custom

Here I chose the custom (here is the standard, after the installation can still be adjusted in the settings):

Choose a background style.

Note: The Android SDK location is the installation address of the SDK, if you have downloaded the SDK yourself, you can select the past, or specify a download directory, the SDK will be downloaded to that place.

I'm here to point to a self-downloaded address.

Check if there are components that need to be updated:

I am here because the SDK has been downloaded in advance, so the update is very fast.

This is the first interface to open, and here's a description of each:

1. Create a new as project

2. Open an already existing as project

3. Import Android Sample code

4. Checking out from the version control tool

5. Import code from other Ides (Eclipse,gradle ...)

6. Configuration

7. Help documentation

Below we choose the configuration to simply configure our environment.

Above to see the English also know the general meaning, here explain:

1.SDK Manager

2. Settings

3. Plugins

4. Import Settings

5. Export Settings

6. Check for updates

7. Default project structure (where you can configure the location of the JDK and Android SDK)

Click Setting to enter the settings:

1. Modify the font style of the menu bar

Theme is the overall color of the IDE, the front is not selected here can be changed. Override default fonts. Default is not set, here you can set the font we need to show the menu bar.

2.IDE Open Mode

The first is to open the most recent project at startup, and the second is to confirm when you close the IDE, and choose whether to keep it according to your own circumstances.

3. Editor Font modification

The default style is Darcula can not be modified, this time you need to save as a copy, can be modified (other related styles need to save their own before you can modify)

Show only monospaced font is only shown in equal width font, line spacing is line spacing,

The following hint means that if the primary font fails, the IDE uses a second font, and Secondaryfont is the setting for the second font.

Other configurations can be tried on their own, including font and color settings for each part of the IDE.

4. Default file Encoding

For character compatibility issues, it is recommended to use utf-8 uniformly.

5. Display line Numbers

The setting of the display line number is different in the lower version as and the higher version, the setting location of this version is shown.

6. Remove spell Check

Personal feeling is not very useful.

7. Disable non-essential plugins

Red Box Live is a person feel not used plug-in, one screen display is not full, the following instructions:

1.CVS integration: Old version Control tool, now basically no one use it?

2.Google cloud testing, Google Cloud Tools for AS, Google Login, Google serices: Goojje in the country has been wall, so also useless ... However, if you disable these, you may not be able to import Google samples.

3.hg4idea:mercurial version control tools, you can't use them.

.... Other plugins according to their own circumstances.

8. Automatic import of class references

When you copy a piece of code from somewhere else into Android studio, the default Android studio does not automatically import references to the classes used in this code. Set tick Add unambiguous improts on the fly.

Iii. setting up a virtual machine to run the first test program

1. Create an as Project

Open as to select a new as project:

1. Application Name: Program name (app name)

2. Company domain: Corporate domains

3. Project location: Where the item is stored

The package name will be automatically generated based on the name of the app you fill in and the company domain name.

Select the minimum supported SDK version.

Select the new activity type by default, where the virtual machine environment is tested, and I choose a blank acitivity with only one textview by default. You can choose according to the actual situation.

Activity created does not explain, I all default, and so on to start coding and then explain.

After the finish, wait for Gradle to build the project, rely on the network, the network bad words may wait for a long time.

2. Project Structure

Click Project on the left to open the project structure, which is divided into two main parts:

(1) App: Here is the main place we need to care about, our coding is mainly done here.

A.mainfests Program Configuration Checklist

B.java This directory mainly stores our source code

Cres This directory holds resource files

(2) Gradle Scripts: This is where the Gradle build tool's build script and related configuration files are mainly stored

3. Configure the Virtual appliance

1.AVD Manager Virtual Device Manager icon, dot meeting Pop-up window for Android virtual Machine Manager

2.Show on disk is the location where the image is displayed on the disc

Why do you want to "Show on Disk" here? Mainly from the installation to now we have not configured the AVD storage location, as will have a default location, but sometimes there is a mirror is avd_home no configuration,

At this point, you need to add the "android_avd_home" variable to the environment variable, and his value is the location where the image is stored. As shown

4. Running the program

Now let's just click on the mini-triangle on the toolbar to run the program.

The initial startup of the virtual machine will be slow, after startup generally do not close it, unless you 1:30 will not write the program ....

1. Swipe to unlock the virtual machine

2. Select the running virtual machine, click OK, if you do not want to select each time, you can choose the use same device ... Run the selected virtual machine as the default machine.

OK, run successfully.

Iv. PostScript

The later update time will follow up with my own study time, so not necessarily what time will be updated, this article is more set instructions, also see some netizens articles, mostly low version as configuration instructions,

In the new version of a lot of changes in the location, but still very grateful, some content if I understand the wrong, please do not hesitate to enlighten the master.

Http://www.cnblogs.com/boyliupan/p/4725908.html

Android Development Self-study note (based on Android Studio1.3.1)-1. Environment Construction (EXT)

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.