About Android Studio
Android Studio is Google's recommended Android development IDE in recent years, compared to eclipse, it has made a variety of heart-based optimizations for Android Development and offers a range of handy gadgets. Let's try it here.
Environment:
Windows 8.1 64bit
Gionee C605
Download & Femdom
After downloading the double-click the next step is possible.
The main aspect of femdom is theme and font settings. The relevant settings are in File->settings.
The UI font is set to Ya-Black 14, and the editor font is set to Consolas 16.
Real-Machine testing
First of all suggest to the computer to install the driver of the mobile phone, the simplest way is to use the Penguin app Bao Lian, the driver automatically installed.
Create a test project, plug in your phone, run.
Look at the directory structure, and the Eclipse project is a bit of a community, it is best to switch to project mode (upper left corner there), the directory is said
Top-level Catalogs
1. App
The location, source code, resources, etc. of application related files.
2. Idea
Where some meta data is stored, such as the Project.Properties file in Eclipse.
3. Build
The outermost build here refers to the file that the Gradle script executes.
4. Gradle
Gradle where the build script resides
Detailed directory under the app
1. Build
Similar to the build directory inside Eclipse, most are bytecode files generated by Java.
2. Libs
Similar to the build directory inside Eclipse, store the. jar file that needs to be referenced
3. src
The Java files and resource files are subdivided.
And Eclipse have the following differences
1. There is a concept of project and module in studio, which says that a window in studio can have only one project, project, which represents a workspace, but a project can contain multiple module For example, the Android library, Java Library and so on, which are referenced by your project, can be regarded as a module;
2, the above directory will be Java code and resource files (Pictures, layout files, etc.) all boil down to SRC, in the SRC directory has a main group, while dividing the Java and res two folders, Java folder is equivalent to the SRC folder under Eclipse, The RES directory structure is the same.
The concept of Modular
Modules is a "discrete unit of functionality that can be run, tested, and debugged independently" and is somewhat simila R to an Eclipse project with a few key differences.
Each of the Module needs to has it's own Gradle build file (generally automatically generated for the when you create a new one, Otherwise you can generate them if is exporting a project from Eclipse). These Gradle files contain important details such as supported Android version ranges, dependencies and other Meta-data AB Out your Android project.
Just like in Eclipse, some Modules could be "library Modules" which is conceptually the same as "library projects."
Modular is created directly file->create new is available.
Gradle Getting Started
A little bit of a look, the feeling is a more flexible project configuration tool.
App/build.gradle content is as follows
The statement is Android program apply plugin: ' Com.android.application ' Android { //Compiled SDK compilesdkversion Buildtoolsversion "22.0.1" defaultconfig { //app's package name ApplicationID " Com.studiotest.river.testapplication " minsdkversion targetsdkversion 1 versioncode Versionname "1.0" } //compile option buildtypes { //release compilation mode release { minifyenabled false proguardfiles getdefaultproguardfile (' proguard-android.txt '), ' Proguard-rules.pro '}} } Package dependent dependencies { compile filetree (dir: ' Libs ', include: [' *.jar ']) compile ' com.android.support: appcompat-v7:22.1.1 '}
Gradle-wrapper.properties-Declares the directory and download path for Gradle and the Gradle version used by the current project
#Wed APR 15:27:10 PDT 2013distributionbase=gradle_user_homedistributionpath=wrapper/distszipstorebase=gradle_ User_homezipstorepath=wrapper/distsdistributionurl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
Build.gradle The English note has been written very clearly, as the top-level build file, you can add compile options for all module, such as the minimum gradle version.
The repositories is used to declare the source of the warehouse.
Top-level build file where can add configuration options common to all Sub-projects/modules.buildscript { repos itories { jcenter () } dependencies { classpath ' com.android.tools.build:gradle:1.2.3 ' //NOTE: Do not place your application dependencies here; They belong //In the individual module Build.gradle files }}allprojects { repositories { jcenter () }}
About Jcenter
Jcenter is the "place to find" and share popular Apache maven packages for use by Maven, Gradle, Ivy, SBT, etc.
For the most comprehensive collection of artifacts, point your Maven at:http://jcenter.bintray.com
Want to distribute your own packages through Jcenter? You can link your package by clicking the ' Include My Package ' button.
And if you're in legacy, you can even synchronize your packages directly to Maven Central.
Reference
Android Studio Series Tutorial Four--gradle basics-http://stormzhang.com/devtools/2014/12/18/android-studio-tutorial4/
Migrating from Eclipse projects-http://tools.android.com/tech-docs/new-build-system/migrating-from-eclipse-projects
Explore Android Studio