My code worked in <5 but in Android 5.0 I\'m running into an issue that I don\'t quite understand.
10-23 10:18:18.945: E/AndroidRuntime(8987): java.lang.I
I'm working on a project where we want to allow users to use older devices. I came up with the same solution as the one mentioned in Marias answer, however I've added a conditional statement for the setPackage call since it is only available in API 4 (Ice Cream Sandwich == SDK 14) and above. If developing for versions below that I reckon you don't need to include the setPackage call.
In function com.google.android.vending.licensing.LicenseChecker.checkAccess(callback)
Intent serviceIntent = new Intent(new String(
Base64.decode("Y29tLmFuZHJvaWQudmVuZGluZy5saWNlbnNpbmcuSUxpY2Vuc2luZ1NlcnZpY2U=")));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
serviceIntent.setPackage("com.android.vending");
}
boolean bindResult =
mContext.bindService(
serviceIntent,
this, // ServiceConnection.
Context.BIND_AUTO_CREATE);