johgru
johgru

Reputation: 241

Check if the user is a developer

I can't purchase in-app content for my app because I'm using the same account on my phone as on Google Developer page.

If the user purchases the "premium" add-on for my app it enables some extra features.

Like this:


 if(premium == true){
 enable extra features...
 }

Is there some way check if the user is a developer?


 if(developer == true){
 enable extra features...
 }

Upvotes: 0

Views: 131

Answers (1)

Aviad
Aviad

Reputation: 1549

You can try this one.. Get account from device and in case this is tour account allow the features

premission:

<uses-permission android:name="android.permission.GET_ACCOUNTS" />

Code:

Pattern emailPattern = Patterns.EMAIL_ADDRESS; // API level 8+
Account[] accounts = AccountManager.get(context).getAccounts();
for (Account account : accounts) {
    if (emailPattern.matcher(account.name).matches()) {
        String possibleEmail = account.name;
        ...
    }
}

Something like that.. Hope that helps

Upvotes: 1

Related Questions