Android licensing sample returns code 3. What does it mean?

nms picture nms · Aug 8, 2012 · Viewed 9.7k times · Source

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?

Answer

yorkw picture yorkw · Aug 8, 2012

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.