[Android Studio] Using the Android Studio Tutorial (ii)

Source: Internet
Author: User

The following is the second article of the IDE Android Studio tutorial released by the Google I/O conference:


The basic use of Android studio, including installation, new engineering, engineering structure, and theme settings, is briefly described in the use of the Android Studio Tutorial (i). The second article goes on today, mainly including the following:

    • Import projects from Eclipse to Android Studio
    • The difference between Eclipse Engineering and Android Studio
    • Real-computer operation and common shortcut keys
I need to reiterate that all of my operations and versions are based on Mac systems, and the students on Windows are basically similar (as a technician, these should not be a problem), let's start with the following sub-themes:
first, import projects from Eclipse to Android StudioAccording to the official introduction, Android Studio can be compatible with Eclipse's existing project, but requires some action:
    1. 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)
    2. 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
    1. The Eclipse project can be imported into Android studio to run, whereas the project built in Android Studio cannot run in eclipse;
    2. 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.
    3. 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.
    4. 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 keysin Android Studio, click on the android tab below the interface to see the device information and Logcat, and the Android tab will detect the real machine after you connect to it, and it will appear in device after success. Click on the little green Arrow at the top to start 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:



 

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.