recently saw many Android developers around the use of Android studio, so they also made a try how to use. In fact, this development tool in 2013 I knew, then because I was too lazy, I did not use it. Now discovering that if you don't use Android studio in future Android development is definitely a big problem! Here are some of the problems you have encountered in using and sharing.
1. The habit of eclipse programmers, when the first contact with Android Studio (hereinafter referred to as) will not be sure, why? There is a workspace in Eclipse (workspace) which can build a lot of project, but in as if your first use must be very unaccustomed to find that workspace. This is where you can choose project or Android (after selecting Android as will merge the folders in res). There are several options under scopes, and the reader will understand if you try it yourself.
2. Build.gradle file I saw a lot of introductions about Gradle when I first met as, and I didn't solve my problem. The following is the default Build.gradle file
Buildscript { repositories { jcenter () } dependencies { classpath ' com.android.tools.build: gradle:1.0.0 ' //Note:do not place your application dependencies here, they belong //In the individual module bu Ild.gradle files }}allprojects { repositories { jcenter () }}
If the Build.gradle in a project Dependencies Add such a code
Compile ' com.android.support:appcompat-v7:21.0.3 ' compile ' com.squareup.dagger:dagger:1.2.2 ' compile ' com.squareup.dagger:dagger-compiler:1.2.2 ' compile ' com.jakewharton:butterknife:6.0.0 ' compile ' com.squareup.retrofit:retrofit:1.9.0 ' compile ' com.android.support:support-v4:21.0.3 ' compile ' com.android.support:appcompat-v7:21.0.3 '
The premise is that your network can access to foreign networks, otherwise your project in Gradle unsuccessful, will be error (Note If your configuration and the same as above in the use of compile need to be able to access the foreign network). There is, of course, another way to do this.
Buildscript { repositories { mavencentral () maven{ url "file://E:/githubrepo/releases" } Or use the specified remote MAVEN library maven{ url "http://mvnrepository.com/" } } dependencies { classpath ' com.android.tools.build:gradle:1.0.0 ' //Note:do not place your application dependencies here; they belong // In the individual module Build.gradle files }}allprojects { repositories { mavencentral () }}
Change the above jcenter to Mavencenter, and add the URL will not need to access the foreign network, easy to solve.
The above is I just contact as the novice a bit of sharing, if not written welcome to the vast number of programmers friends to leave me a message! Finally hope in contact with new things, do not have a reluctant to accept the psychology, if the first person to eat crabs, because in the programmer, there are many more than you strong characters, don't you want to go over them? Let's cheer up ...
The most basic knowledge of Android Studio One