Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting Up the Licensing Verification Library on Android Studio

im'triyng to implement the Google Licensing Verification in a Android Studio made app. By following this lines: http://developer.android.com/google/play/licensing/setting-up.html seems tath:

As an alternative to adding the LVL as a library project, you can copy the library sources directly into your application. To do so, copy (or import) the LVL's library/src/com directory into your application's src/ directory.

I've done this but the import of:

import com.google.android.vending.licensing.LicenseChecker; import com.google.android.vending.licensing.LicenseCheckerCallback; 

fail.. Searching on google i've been noticed that i need to modify the build.grade file on my project, but i can't find a specific solution.

How can I reference the LVL in my android studio project? There is some tutorial or example?

Thanks Lorenzo

like image 323
Cybergatto Avatar asked Aug 26 '13 17:08

Cybergatto


People also ask

How do I install Google Play licensing library?

Right click on your app that you are adding licensing to, and click properties, then hit Android . Go to the bottom and click library and add it to the build path. This should import the library to the Android Dependencies folder.

What is license verification Android?

How does the license verification library work? It manages a connection between your app and the Android Market (now Google Play), and performs a license check with the server to see if the user has a valid license for your app (i.e. it was purchased legitimately through the market).

What is Google Play licensing library?

Google Play offers a licensing service that lets you enforce licensing policies for the apps that you publish on Google Play. With the licensing service, your apps can query Google Play at runtime to obtain their licensing status for the current user, then allow or disallow further use as appropriate.

What is LVL library?

The License Verification Library (LVL) is a library you can add to your application that handles all of the licensing-related communication with the Google Play licensing service.


1 Answers

  1. In Android Studio, Tools-Android-SDK Manager
  2. In SDK Manager, in the extras section choose Google Play Licensing Library
  3. Go back to Android Studio, and choose File-New-Import Module
  4. ADK Manager will have put the downloaded files under your SDK directory, in my case Desktop/android-sdk-macosx/extras/google/play_licensing/library
  5. Choose to import this directory as a module, and give it a name. I used 'lvl'
  6. Optionally change targetSdkVersion in the lvl module's build.gradle to match your project targetSdkVersion.
  7. Then in your projects build.gradle, add the line compile project(':lvl') inside the {dependencies{ section.
  8. Re-sync Gradle and everything should compile correctly.
like image 149
Nick Fortescue Avatar answered Sep 28 '22 16:09

Nick Fortescue