The most basic knowledge of Android Studio One

Source: Internet
Author: User

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

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.