I tried licensing sample. It said "application error=3". I found the sheet of licensing response codes at developer.android.com, but how does number 3 corresponds to the above list? What does that code mean?
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). In other words, it's a form of Digital Rights Management (DRM).
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.
Check out source code com.android.vending.licensing.LicenseValidator:
/**
* Contains data related to a licensing request and methods to verify
* and process the response.
*/
class LicenseValidator {
private static final String TAG = "LicenseValidator";
// Server response codes.
private static final int LICENSED = 0x0;
private static final int NOT_LICENSED = 0x1;
private static final int LICENSED_OLD_KEY = 0x2;
private static final int ERROR_NOT_MARKET_MANAGED = 0x3;
private static final int ERROR_SERVER_FAILURE = 0x4;
private static final int ERROR_OVER_QUOTA = 0x5;
private static final int ERROR_CONTACTING_SERVER = 0x101;
private static final int ERROR_INVALID_PACKAGE_NAME = 0x102;
private static final int ERROR_NON_MATCHING_UID = 0x103;
... ...
"application error=3" means ERROR_NOT_MARKET_MANAGED, check out answer here to see how to deal with it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With