How do you use the Android.Play.ExpansionLibrary libs? RRS feed

  • Question

  • User28549 posted

    I've been searching around trying to figure out how exactly one is to use the Android.Play.ExpansionLibrary.

    I've simply got an app with about 150MB of audio tracks that need to be uploaded to the play store.

    I'm looking at the source of that repo, and the actual use is eluding me. I can't find any documentation on how to create an expansion APK, and then how to use it in my app.

    I'd obviously like to be able to use it when debugging, but also upload it to the Play Store and download it when the app is purchased.

    Is there a solid tutorial out there on how to handle Expansion APKs?

    Friday, January 31, 2014 9:27 PM


All replies

  • User68536 posted

    @ChaseFlorell?, I know this is pretty old, but I have updated the Android.Play.Expansion library a bit.

    I have also created a NuGet for the Licensing (LVL) and the Expansion Downloader. You should be able to just add these to your project and implement the necessary interfaces.

    I have a short blog post to get started with Play Licensing and a slightly longer one for using the expansion downloader.

    I hope that this will make it easier to get started using the libraries and expansion files.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, December 23, 2014 9:12 AM
  • User28549 posted

    @mattleibow, this looks awesome. I don't currently have the need, but will definitely bookmark!

    Wednesday, December 24, 2014 7:21 PM
  • User68536 posted

    Hi all, I just wanted to let you know about the deprecation of my C# port of the expansion library (Android.Play.ExpansionLibrary). This port has been replaced with a better binding of the official Google code:

    • https://github.com/xamarin/XamarinComponents/tree/master/Android/GoogleAndroidVending

    This new library has breaking changes from the v1.x of both the C# port and the initial binding. This new update has far more enums and types that will help discoverability - the old API had a lot of int and string parameters.

    To aid in the upgrade process, I have created a doc that should cover all the changes and their replacements:

    • https://github.com/xamarin/XamarinComponents/blob/master/Android/GoogleAndroidVending/docs/API-Changes.md

    I hope the upgrade is not too painful, please feel free to ask me directly (or via an issue or forum post) if you have any questions.

    I have also created fairly extensive docs on how to get started with the library, although if you are already using Android.Play.ExpansionLibrary then this may not be necessary:

    • https://github.com/xamarin/XamarinComponents/tree/master/Android/GoogleAndroidVending/docs

    The new NuGets are:

    • https://www.nuget.org/packages/Xamarin.Google.Android.Vending.Licensing
    • https://www.nuget.org/packages/Xamarin.Google.Android.Vending.Expansion.Downloader
    Thursday, September 7, 2017 12:56 PM
  • User24062 posted

    Hi Matt,

    I've been using the older version of the plugin and spotted the update today downloaded the sample and built it. Previously someone mentioned they had a problem testing alpha apps with it. I've been testing a new app using the plugin and indeed me and my alpha testers are getting a "Buy App" response (app not licensed) from Google. I checked with Google support and they claim that licensing should work with alpha releases. Also with the plugin if I use one of my published apps package name then it returns "Licensed". So it can't be the code.

    Anyone else have problems with licensing working with alpha or even beta versions? I've been using Google licensing library ever since they rolled it out. This is the first time with Xamarin though I also used it on a Unity app but what Unity is doing is fairly hidden.

    Thursday, September 7, 2017 9:06 PM
  • User68536 posted

    I have only been testing on alpha and beta. So that does work. Your testers, did they download the app from the store? You can't sideload, this is what licensing tests for - did they actually download from the store, with their account.

    Thursday, September 7, 2017 9:56 PM
  • User24062 posted

    They downloaded the app from the store with their account.

    Thursday, September 7, 2017 10:26 PM
  • User68536 posted

    I am not sure, it could be several things. But I have created a doc that I think covers all the cases. You could have a look at the testing and things to remember sections:

    • https://github.com/xamarin/XamarinComponents/blob/master/Android/GoogleAndroidVending/docs/Licensing.md#testing-the-licensing
    • https://github.com/xamarin/XamarinComponents/blob/master/Android/GoogleAndroidVending/docs/Expansion.md#testing-the-downloader

    Hopefully something helps there. Let me know, and I will see what I can do.

    Friday, September 8, 2017 8:18 AM
  • User24062 posted

    Yes, all that was followed. But your plugin works fine when tested with my publicly released apps. I'll see if Google can check things at the server. I noted that on the original version of the plugin on GitHub someone had mentioned they too had problems with alpha testing. Never posted back if they solved them though.

    BTW, the CHECK_LICENSE permission isn't in the AssemblyInfo.cs file though the INTERNET permission is. So folks will want to be sure to add it when trying the plug either to that file or the manifest. It's not listed in the permissions under Android Properties.

    Thanks for the plugin.

    Friday, September 8, 2017 5:09 PM
  • User24062 posted

    I got it to work. It was a public key issue.

    Sunday, September 10, 2017 9:18 PM
  • User68536 posted

    @BrianConrad Good to hear that you got it going.

    WRT the CHECK_LICENSE permission: it should be added automatically now.

    Tuesday, September 12, 2017 10:55 AM