简体   繁体   中英

Import Google Play Service library to Android studio 1.0

I'm trying to implement GCM in an Android project with Android Studio 1.0.

I've installed Google Play Service library but I'm confused about ,how to import the one to project.

Does anyone know how to do it?

Thanks in advance!

Since you are using Android Studio, you are presumably also using Gradle. If this is the case, then you do not need to worry about importing any projects.

Simply open up the build.gradle in your app module, and locate the depencies {} closure.

Inside of this section, add the Google Play Services dependency like so:

dependencies {
    // ...

    compile 'com.google.android.gms:play-services:6.5.+'
}

Once you have done that, you can use any classes from Google Play Services anywhere in your application.

Be sure to read through the Setting up Google Play Services documentation , as you also need to include a <meta-data> element in your manifest, and you can also choose to selectively include only the parts of Google Play Services that you will be using.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM