Android Studio Trial Summary

Source: Internet
Author: User

Android Studio is an Android development IDE launched on Google I/O a year ago, based on JetBrains ' IntelliJ idea, which is still in the preview phase. Enhanced layout drag-and-drop and preview capabilities, using the new build system Gradle, which adds Android-related refactoring and quick fix functionality. I've heard that it's easy to build apps with Android Studio, and when you learn about common Android Open source projects, most of them offer support for Android studio, so it's frustrating to share some experience.

Most Android studio early adopters encounter the biggest obstacle is gradle, boot time is very slow, he needs to from the MAVEN library things, network instability, this is the pit, do not know how others solve, I was FQ, light this stopped the Android Studio continent-wide promotion, and many people work together when the companion is not necessarily accustomed to this thing. If the problem is solved, we need to understand the construction principle of gradle, which also takes a lot of effort, last year, Google I/O on the 40-minute video to illustrate how he works, link here, very clearly, on LinkedIn to find the title of the presenter is "Tech leads for The Android SDK at Google.

You can create a new HelloWorld engineering sensibility to recognize the use of Android studio. You will certainly compare him with eclipse in this process, unfortunately, their directory structure is not as Appcode and Xcode as the full compatibility of the directory can be seamlessly replaced with each other, not directly import the other side of the project, Although Eclipse now provides the ability to export existing projects and import them into Android studio, the process is not painless, it can be a bit of a problem, and in turn, exporting projects from Android studio to eclipse That's a matter of sheer trouble.

Android Studio project contains one or more module, where the module can be an Android app or a library, in general, Creating a new project automatically creates a new module, which compiles the module and generates the required APK. What do we do when we need to introduce an open source library? You can create a new module, select a type of ' android-library ', and then let the main module depend on it (this process is like eclipse, where different projects can have referential relationships). But Android Studio is doing something behind the back, In fact, each module has a Build.gradle file that describes the conditions required for this module build, and the entire project also has a Build.gradle file, which is the condition that all module constructs need to meet, and the last item has a settings.gradle, which records the item What module is in the eye. When you change the module and modify the dependencies, you are actually modifying the files.

In fact, the most convenient thing is what I want to say next, many open source projects should be integrated into the MAVEN library, we can easily refer these projects to their own projects, instead of going to GitHub clone code and then copy and configure. Let's take the pull refresh component Actionbar-pulltorefresh As an example, we just need to add a word "compile" to dependencies in the Build.gradle that needs his module Com.github.chrisbanes.actionbarpulltorefresh:library:+ ' "On the line. Android Studio will download it by itself, so it's not convenient for you to try it out. If you do not know the MAVEN library, you can right-click on the appropriate module, select "Open Module Setting", Find the Dependencies tab, click the plus sign below, select "Library Dependency", Then search on the line, in fact, commonly used android-async-http,actionbarsherlock,android-universal-image-loader and so on, you don't have to add a bunch of redundant code in the Git warehouse, Just add a line to the Build.gradle, why not?

In the process of developing Android applications, it is inevitable to use Android.support.v4.jar, the general practice is to put him from the SDK into the project's Libs directory, to avoid others copy the code after not compiled through. Then, when referencing multiple open source projects, there is a case of conflicting versions, and the general practice is to replace the conflicting jar packages with the same one, but the error messages generated when you don't know how to fix them are frustrating, and fortunately, in Android studio this doesn't happen, You only need to add a sentence in the build.gradle of the corresponding module dependencies "Compile ' com.android.support:support-v4:+ '", multiple modules refer to him when there is no conflict.

Say so many gradle related, say the IDE itself some advantages and disadvantages of it:

Startup and compilation are slow. I do not know what the reason, with the Mac, solid-state drive, supposedly should be very hi. Every change to Build.gradle will result in an Android studio operation ' Sync ', and then the interface will be stuck. This is a bug, and occasionally appear internal error, fortunately the frequency can be accepted. The compilation is also slow, and the "Tech leads for the Android SDK" needs to be more powerful.

The interface looks good. Using several JetBrains products, the interface is quite comfortable, the most available only two sets of themes, before using Eclipse, I really can not endure the interface thick Java UI breath, and the icon will also have jagged edges.

Convenient Color picker. In the layout file, such as you useful to android:background= "#ffffffff", then in the left side of the line will appear a box, inside is white, you click on this white box, pop up a dialog box to select the color, very intuitive.

Direct display of resource content. If you use android:layout_width= "@dimen/image_width", Android Studio will replace the value of image_width directly inside the quotation marks.

DDMS integration is not very good. Open Android Monitor, impressively an AWT interface appears in front of you, no sense of beauty. But the basic logcat, screenshots, debug functions are all there.

Overall, Android Studio is also in line with the needs of individual developers, I usually write something small words are used in Android studio, I believe he will be more and more good, look forward to the official version of the day.

PS: Next time this content of something to consider directly recorded a short video put over, the entire text do not know if someone will be bored:-D

Android Studio Trial Summary

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.