Why is the Google Play Billing Library not shown up in the SDK Manager?
Asked Answered
N

3

6

I'd like to make an android application with in app purchases, I read often that I have to download the Google Play Billing Library from SDK Manager

(e.g. http://www.techotopia.com/index.php/An_Android_Studio_Google_Play_In-app_Billing_Tutorial#Installing_the_Google_Play_Billing_Library ), but I can't find it there. Does I need this file? If yes, how can I manage that it is shown to me? On the developers.android webside is nothing written of the Google Play Billing Library, but if I copy their sample code to my project, I get many errors. I searched for Example projects for example on github, I found one, but when I run it, the app crashes. Is there any sample project, I think this would solve my problems?

My SDK Manager

THANKS !!!

Nighthawk answered 24/9, 2017 at 15:11 Comment(0)
A
16

Checking the offical blog:

Play Billing Library is available through Maven repository

Just add:

dependencies {
    ...
    compile 'com.android.billingclient:billing:1.0'
}

You can find more details about the library in the official doc.

Acidulant answered 24/9, 2017 at 17:14 Comment(3)
thanks, but what is the maven repository. I added your lines, but I still cannot see the billing library in the sdk manager...or what should change then?Nighthawk
The library is not in the SDK manager. Adding the dependency is enough to download it with gradle in your project.Acidulant
That's the right answer. The library is distributed via Maven and jCenter and it's not distributed via SDK Manager.Appear
F
2

You are referring to the old Google Play Billing library (v3), which if you really want to implement you can find it as part of the TrivialDrive demo app below. You can copy parts that you need (aidl, util) and change your app as per demo sample.
https://github.com/googlesamples/android-play-billing/tree/master/TrivialDrive

~~~

The new version of Play Billing library v1.0 is covered by Garbriele Mariotti's answer (above). If you happen to use a platform that doesn't support Maven, Gradle or AARs I will be making it available soon (UPDAT to follow) as an Eclipse based project that you may be able to import into your IDE the same way you wanted to import the old library downloaded through SDK Manager (which probably doesn't include it anymore as they dev team doens't want you to use it anymore).

If you just want to download it and look at it, you can download it from here:
https://google.bintray.com/play-billing/com/android/billingclient/billing/1.0/

~~~

Google Play Billing 1.0 library for Eclipse available from here:
https://github.com/dandar3/android-google-services-billing/tree/1.0

Faradmeter answered 21/11, 2017 at 13:47 Comment(0)
W
0

Play Billing Library is available through Maven repository.

Add in top level build.gradle file

    buildscript {

    mavenCentral()     
    }

    ................
    allprojects {

    repositories {

    mavenCentral()
       }
    }

Add dependency into module level build.gradle file.

   implementation 'com.android.billingclient:billing:1.0'

Then After implement in app billing sample example into your project.

https://codelabs.developers.google.com/codelabs/play-billing-codelab/#0

This link you can find sample code of in app billing example of google

https://github.com/googlesamples/android-play-billing

Whoops answered 4/3, 2019 at 5:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.