Android Studio Using tutorial graphics

Source: Internet
Author: User

Android Studio is a very professional Android integrated development environment tool, so how does Android studio work? For those of you who do not know how to use Android Studio, this article for everyone in detail about the use of Android Studio tutorial, interested friends can understand the next

Android Studio 1.0 Official Edition finally released! Google says Android Studio 1.0 makes developers "faster and more productive" and believes it can replace eclipse while providing the migration steps for Eclipse users. The code automatically prompts, runs faster, and is better than eclipse. The following is a record of the use of Android studio and the two days I use some feelings, first declare that I tried on the Mac, I heard that in Windows lag and memory consumption is large, on Linux and Mac use should be good.

First, download the installation

To http://developer.android.com/sdk/installing/studio.html Download the installation package (DMG file), open and drag Android studio to applications, copy it , you can drag the icon to the dock under the application.

Second, the new project

When the installation is complete, select the default option and click OK:

Go to Android Studio, start the interface and Xcode a bit similar, click New Project to create a project, the new process and the same as in eclipse, here will not repeat. Is the start interface:

The new project was completed and entered the Android studio main interface. The first time you go in there may be nothing as shown, click the arrow button to expand the directory structure,

When you expand, you can see the directory structure of Android studio, and the project for Eclipse is a little different:

Difference:

The directory structure of the 1.Android studio represents a workspace, a workspace that can have module (modules, components) that can be used to understand a module as a project in eclipse;

2. The directory will be Java code and resource files (Pictures, layout files, etc.) all boil down to SRC, in the SRC directory there is a main group, while the Java and res two group,res and the structure under Eclipse, Java is the source of the package and class files;

3. New file mode, the right button to choose New or Command+n after the new menu, type has Java class, that is, the general Java class, file is ordinary files, package is built, it is worth noting that the Android Component, It directly provides the creation of basic components in Android.

You can choose to create different types of components in Android:

Three, window layout and theme Introduction

Also, at the bottom of the main interface is a tab called Android that opens to see the device information and logcat output in DDMS:

In the top toolbar you can see the same options as the features in Eclipse, which are all familiar to you:

The last thing to note is that you see my main interface is dark color style, and Google demo is the same style, everyone first use Open is the default style (bright), if you want to change, enter preferences (press command+,) to the IDE Settings Select Colors&font and set the schema name to Darcula can be set to dark color style, if you need to define the style, such as font size color, you can create a schema to define their own

Iv. Layout file Authoring (real-time preview)

The most dazzling features to come, write and preview the layout file in real time, this function really greatly improve the development efficiency, open an XML layout file click on the right preview tab to call out the previewing interface, you can choose a lot of size of the phone to preview:

At the same time, can also preview a variety of different models and sizes of equipment, writing code at the same time to adapt to a variety of models, this is not the original dream!

The basic use of Android Studio is described above, including installation, new engineering, engineering structure, and theme settings. Here are some other tips, as well as some of the previous comparisons with Eclipse. Need to reiterate that all of my operations and versions are based on Mac systems, on the windows of the students basically similar, the following sub-topic start:

First, import projects from Eclipse to Android Studio

According to the official introduction, Android Studio can be compatible with Eclipse's existing project, but requires some action:

First upgrade ADT to the latest version, currently with version number 22 (note that the components associated with ADT should be upgraded to avoid possible late errors)

Select the project you want to export from Eclipse, right-click Export and select Generate Gradle Build Files under Android (for example):

After the selection is not exported to other places, but in the local project generated a build.gradle file, in the Eclipse project can also be seen, this file is recognized by Android studio, such as:

3. Then go to Android Studio and select Import Project, and you can see that the project icon just in Eclipse has become an Android robot icon, indicating that the conversion was successful, when you select Project Import:

Now that you've finished importing an existing Android project from Eclipse to Android Studio, you're ready to start working on the project!

Ii. the difference between Eclipse Engineering and Android Studio

The Eclipse project can be imported into Android studio to run, whereas the project built in Android Studio cannot run in eclipse;

The engineering structure of the two is different, and in Eclipse, a project represents a program engineering, and in Android studio, like IntelliJ, a project represents a workspace, equivalent to the workspace in Eclipse, A module in Android Studio is the equivalent of a project in Eclipse, a concept that needs to be understood, not mixed, or confused.

On the edit operation, you must manually command+s save the file after editing the changes in Eclipse, and in Android Studio it is automatically saved as IntelliJ, which is similar to the 2nd and Xcode.

The difference in the project catalog, in Eclipse in the SRC section is generally a Java file, the res part is a resource file, including layout files and multimedia resources. In Android Studio, you can look at the directory structure:

including Java files and resource files are placed in the SRC directory, the SRC directory includes a main folder, and the following is the Java folder and Res folder, in fact, here, the Java folder is equivalent to Src,res in eclipse or that res, Here reminds of Motoyama Teacher's sketch "Src is not that SRC, res or that res."

Third, the real machine operation and common shortcut keys

In Android Studio, click on the Android tab under the interface to see device information and Logcat, the android tab after connecting to the device will detect the real machine, after success will be displayed in the device, click on the top of the small green Arrow can start to run the project. One thing to note is that the runtime can choose the simulator or the real machine, because there is a device priority selection when running the project in Android Studio, if not set, there may be only running on the emulator, We can set it ourselves: first click on the Run menu to select Run Configuration, and select the target device you want to select, can be simulator and real machine, also can be selected by the user in the run:

Shortcut keys you can be familiar with the official documents, such as the following table, you can also modify the configuration options to customize:

Personally think that Android studio still has a certain prospect, here it needs to continue to improve and improve the Google, and quickly get everyone out of eclipse. In addition, in the meantime, you can actually try to use IntelliJ idea, which is the default integration of the Android development environment. Android Studio is based on the former improvements, the two are similar in use, but also a good alternative to eclipse. A Windows edition android studio download is available below.

Android Studio Using tutorial graphics

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.