<span id="Label3"></p><p><p>This year's Google global developers conference, although there are no new Android systems and devices, but also launched some good products, Android Studio is one of Them. This Android ide, based on IntelliJ idea, makes a lot of people light up, in fact, writing layout files in real-time preview and adapt to the multi-screen function can be said to be suffering from the interface layout development people see Hope. The code automatically prompts, runs faster, and is better than eclipse. But this release is a preview version after all, so the improvement of the control is very large, we also do not spit groove bad or difficult to use, there is room, so there is progress. Google also set the version number to 0.1 instead of 1.0, it can be seen that the improvement of space, we could try, waiting for the perfect version of the continuous Launch. Today to record the use of Android studio and the two days I use some of the 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.</p></p><p><p></p></p><p><p></p></p><p><p>first, Download the installation</p></p><p><p>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.</p></p><p><p></p></p><p><p></p></p><p><p>second, The new project</p></p><p><p>When the installation is complete, Select the default option and click Ok:</p></p><p><p></p></p><p><p></p></p><p><p>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:</p></p><p><p></p></p><p><p></p></p><p><p>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,</p></p><p><p></p></p><p><p></p></p><p><p>When you expand, you can see the directory structure of Android studio, and the project for Eclipse is a little different:</p></p><p><p></p></p><p><p>Difference:</p></p><p><p>The directory structure of the 1.Android studio represents a workspace, and a workspace can have a module that can be used to interpret a module as a project in eclipse;</p></p><p><p>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;</p></p><p><p>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.</p></p><p><p></p></p><p><p></p></p><p><p>You can choose to create different types of components in Android:</p></p><p><p></p></p><p><p></p></p><p><p>three, window layout and theme Introduction</p></p><p><p>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:</p></p><p><p></p></p><p><p></p></p><p><p>In the top toolbar you can see the same options as the features in eclipse, which are all familiar to you:</p></p><p><p></p></p><p><p></p></p><p><p>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</p></p><p><p></p></p><p><p></p></p><p><p>Iv. Layout file Authoring (real-time Preview)</p></p><p><p>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:</p></p><p><p></p></p><p><p></p></p><p><p>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!</p></p><p><p></p></p><p><p></p></p><p><p>Ok this one write to this, Spit groove, csdn Blog editor and image upload editor is too difficult to use, especially the picture upload, all kinds of uncomfortable, you can learn under the QQ mailbox after uploading the size bar, the interface cut a picture to occupy the majority of the screen, so many years, the upgrade under, let write Bo human how to Ah. In addition, these two days on the internet to see a lot of people complaining about the various uncomfortable Android studio, in fact, we do not need to do so, after all, is a preview version, said before, there is room for progress, Android developers will inevitably slowly migrate from eclipse to Android Studio come up, so we are still holding an optimistic attitude to learn and accept it, good things need time to hone and Baptism.</p></p><p><p></p></p>first, import projects from Eclipse to Android Studio<p><p></p></p>According to the official introduction, Android Studio can be compatible with Eclipse's existing project, but requires some action:<p><p></p></p> <ol> <ol> <li>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)</li> <li>Select the project you want to export from eclipse, Right-click Export and select Generate Gradle Build Files under Android (for example):</li> </ol> </ol><p><p></p></p><p><p></p></p>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:<p><p></p></p><p><p></p></p><p><p></p></p>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:<p><p></p></p><p><p></p></p><p><p></p></p>Now that You've finished importing an existing Android project from Eclipse to Android Studio, You're ready to start working on the project!<p><p></p></p><p><p></p></p>Ii. the difference between Eclipse Engineering and Android Studio<p><p></p></p> <ol> The <ol> <li> Eclipse Project can be imported into Android studio and the project created in Android Studio will not run in eclipse; </li> <li> The project structure is different, In eclipse, a project is an artifact, and in Android studio, like intellij, a project represents a workspace, equivalent to workspace in eclipse, and on Android A module in studio is the equivalent of a project in eclipse, a concept that needs to be understood, not mixed up, or confused. </li> <li> on Edit operations, 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. </li> <li> The difference in the project directory, in Eclipse in the SRC section is generally a Java file, the Res section is a resource file, including layout files and multimedia Resources. In Android studio, you can see the directory structure: </li> </ol> </ol>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 the src, res or that res" third, the real machine running and common shortcut keys in Android Studio Click on the android tab below the interface to see device information and logcat, When you connect to the device and open the Android tab to detect the real machine, it will appear in the device after success and you can start the project by tapping the small green arrow at the Top. 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 the simulator and the real machine, also can be selected by the user in the Run: shortcut key people can be familiar with the official documents, such as the following table, you can also Modify configuration options to customize: personally think that Android studio still has a certain future, it needs Google to continue to improve and improve, 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. Later I will record an article dedicated to using IntelliJ idea to develop android! Via<strong><strong>http://www.cnblogs.com/xiaoran1129/archive/2013/05/23/3095135.html</strong></strong><p><p>Initial use of Android Studio tutorial</p></p></span>
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