Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://developer.android.com/google/play/licensing/index.html">Google helps you do this</a>.</p> <p><a href="http://developer.android.com/google/play/licensing/setting-up.html">This page helps you set it up.</a></p> <p>More specifically, <a href="http://developer.android.com/google/play/licensing/adding-licensing.html#impl-DeviceLimiter">it looks like you want to add a DeviceLimiter</a>:</p> <blockquote> <p>In some cases, you might want your Policy to limit the number of actual devices that are permitted to use a single license. This would prevent a user from moving a licensed application onto a number of devices and using the application on those devices under the same account ID. It would also prevent a user from "sharing" the application by providing the account information associated with the license to other individuals, who could then sign in to that account on their devices and access the license to the application.</p> <p>The LVL supports per-device licensing by providing a DeviceLimiter interface, which declares a single method, allowDeviceAccess(). When a LicenseValidator is handling a response from the licensing server, it calls allowDeviceAccess(), passing a user ID string extracted from the response.</p> <p>If you do not want to support device limitation, no work is required — the LicenseChecker class automatically uses a default implementation called NullDeviceLimiter. As the name suggests, NullDeviceLimiter is a "no-op" class whose allowDeviceAccess() method simply returns a LICENSED response for all users and devices.</p> <p>Caution: Per-device licensing is not recommended for most applications because:</p> <p>It requires that you provide a backend server to manage a users and devices mapping, and It could inadvertently result in a user being denied access to an application that they have legitimately purchased on another device.</p> </blockquote> <p>The source code for <code>DeviceLimiter</code> <a href="https://code.google.com/r/android-dev-marketlicensing/source/browse/library/src/com/android/vending/licensing/DeviceLimiter.java?r=9cd599d6902d8b9b8311e4ef8dd20dcccb5e7aba&amp;spec=svn4fe2c52435d8e4ad7d8a47e086b633439f9a8fa6">can be found here.</a></p> <p>The source pretty much explains how you'd go about using DeviceLimiter to implement what you want:</p> <pre><code>/* The LICENSED response from the server contains a user identifier unique to * the &lt;application, user&gt; pair. The developer can send this identifier * to their own server along with some device identifier (a random number * generated and stored once per application installation, * {@link android.telephony.TelephonyManager#getDeviceId getDeviceId}, * {@link android.provider.Settings.Secure#ANDROID_ID ANDROID_ID}, etc). * * The more sources used to identify the device, the harder it will be for an * attacker to spoof. </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload