You never know what you're going to do in the future? You can only do the things you have at hand.
PS. I'm an old man, just touching Android Studio. Just skip the article.
Well, I admit that I am a nostalgic person, eclipse has accompanied me through the years of not knowing how many storms. Suddenly asked me to replace, or really a little reluctant. The main Androidstudio card.
Just out of the days of Android studio, my little friends asked me why I didn't use as? My first reaction is as? Action Script? In fact, we can see from the above logo, both are called Android Studio, just the former based on Eclipse the latter based on IntelliJ.
Now it's a mature stage for Android studio, and thanks to Google's push, I'm also beginning to step into the difficult process of Eclipse's shift to Android studio. (personal habits are hard to change.)
Layout files Change
Catalog of engineering Structures
The change in the structure of the engineering catalogue really made me feel confused when I first started using it. Even if the code is not clear where to write, Libs library should be added where it is not good to say.
eclipsed
Eclipse puts all Android project resources in a single level directory and is fixed. Below, is a common app engineering catalog for Eclipse.
I'm not doing too much of this, and I think everyone knows.
Android Studio
The directory structure of Android Studio has changed, that is, all the code, compilation style, Androidmanifest.xml resources are placed in the SRC directory. As shown in the following:
Obviously, Android studio no longer makes a one-level directory distinction with the functional logic of the code, but instead:
- Build Module (gradle)
- Code Logic module (SRC)
- Third-party library module (LIBS)
- Compile output module (build)
Constructed in a way that is differentiated.
Project, Modules, Workspace
In eclipse, the most common is the workspace, has entered lets you choose. As shown in the following:
We are more familiar with it, for Eclipse, a workspace is a folder directory on the corresponding PC. It can save many of our projects, already our dependencies and configuration logic for eclipse in development.
And in Android Studio, there is no wordspace concept, only one project concept, much like the way Xcode does. An item is a project, where there may be one or more projects. However, each project is related to this project.
Project in this case is not the same as project in eclipse
Modules
Modules is a new concept proposed by IntelliJ, "a standalone functional unit that can be run, tested, and independently debugged" and the concept of Eclipse project is a bit like, but a few different.
- Each module needs to have its own gradle build
File (when you create a new module, it will automatically build for you when you import an Eclipse project). These gradle files contain important content, such as the supported Android versions and items that are dependent on the project, as well as other important data in the Android project.
- As with eclipse, some Modules may be "library Modules", functionally the same as "library projects".
Ant/maven-Gradle
Ant was the first build tool, based on idea, as it was in the 2000, when it was the most popular Java build tool, but its XML scripting format made the XML file particularly large. The process control in the construction process is particularly good.
Gradle is a build script with groovy, much easier to read than XML. People who have used ant know how troublesome it is to express an if branch function in ant, which is not intuitive. Since the Gradle build script is a groovy program, it is convenient and natural to do branch loops.
maven It is used to fill the hole for ant, Maven for the first time to support the download from the network features, still using XML as the configuration file format, its problem is not very good version of the same library file conflicts. MAVEN is focused on managing and building God's horse is not good at it.
- Gradle is a combination of the above two advantages, it inherits Ant's flexible and Maven life cycle management, it was finally Google as a management tool for Android. Its biggest * difference is that it doesn't use XML as a configuration file format and uses the DSL format to make the script more concise.
Changes to shortcut keys
More than this person think, this is my heart pain points, accustomed to the various types of Eclipse shortcut keys after the various plugins. Here, my previous habits are completely inapplicable.
Although the official said there is a powerful hint function, but, personal feeling, in fact, in eclipse loaded a plug-in effect is similar. The project summarizes the contrast effect.
Android Studio default shortcut keys vs. eclipse common shortcut keys
Android Studio |
meaning |
Eclipse |
Notes |
Ctrl + Alt + L |
Formatting code |
Ctrl + Shift + F |
Seems to be invalid for//comment |
Shift + Enter |
Wrap anywhere (add empty lines down) |
Shift + Enter |
|
Alt +/ |
Code hints |
Alt +/ |
As default (Ctrl + Space) conflicts with Windows IME Toggle shortcut keys, set to other |
Ctrl + Y |
Delete When moving forward |
Ctrl + D |
|
Ctrl + Shift + Enter |
Complete the Code |
No |
Replenish the remaining code and ";" |
Ctrl + Shift + F10 |
Run Current project |
Ctrl + F11 |
|
Shift + Alt + up/down |
Move up/down the current row, select rows |
Alt + Up/down |
Can be moved arbitrarily |
Ctrl + Shift + up/down |
The effect is one, there is a limit see remarks |
No |
Cannot move out of the code block where the statement is currently located, same as comment |
Ctrl + C |
Copy the current row or selection |
No |
When no content is selected, copy the forward |
Ctrl + D |
Pastes the current row to the next line |
Alt + Down |
|
Ctrl + X |
Cut the current line or selected content |
No |
|
Alt + Enter |
Automatic correction |
Ctrl + 1 |
|
Ctrl + Alt + O |
Automatic import of required packages and removal of excess packages |
Ctrl + Shift + O |
|
Ctrl + Enter |
Inserts a new row at the top of the current row, and the cursor is valid at the beginning of the line |
? |
The cursor is not at the beginning of the line as normal enter |
Ctrl +/ |
"//" single line comment |
Ctrl +/ |
|
Ctrl + Shift +/ |
/* * * * Add (Cancel) multiple lines of comments |
Ctrl + Shift +/ |
|
Ctrl + Backspace |
Delete by word |
No |
Use after the word you want to delete, and delete the word immediately before the cursor |
Alt + left/right |
Toggle Code View |
Alt + left/right |
|
Of course, note that this is a comparison of the Windows version of Android Studio, the Mac version of Android Studio is still a little different.
Just think of so many, if not the wrong please forgive me, I also just learned Android studio soon.
/*
* @author Zhoushengtao (Zhou San)
* @since August 27, 2015 15:31:22
* @weixin stchou_zst
* @blog http://blog.csdn.net/yzzst
* @ Exchange Learning QQ Group: 341989536
* @ Private qq:445914891
/
Copyright NOTICE: Reprint please mark: Http://blog.csdn.net/yzzst. This article for Bo Master original article, without Bo Master permission not reproduced.
What's changed from Eclipse to Android studio--