I have to add trial version in my app. User will by open my app only 9 times - then body of my application will be blocked. I read that the simplest way is usage in app billing, but my knowledge of billing is almost zero... Could you tell me how to do what i want in the simplest way?
I've trying to create simple billing helper
public BillingHelper(Context context, String skuTrial,
int marketRequest, String publicKey, String prefsName, String tagName) {
isSetup = true;
TAG = tagName;
this.context = context;
this.skuTrial = skuTrial;
this.marketRequest = marketRequest;
this.publicKey = publicKey;
this.prefsName = prefsName;
}
but i dont know what to do next...
Thanks a lot.
PS sorry for my English... ;/
In-App Billing won't help you with this. You need to implement this "9-times open" logic by yourself.
Instead of this I would rather propose to implement a logic counting days since installation. For instance you hide some functions after application has been used for 2 days. You can use
PackageManager
to get the date of first installation.Or is you want to allow a user to reset this counter, you can count days since last installation as following.
Source: How to get app install time from android