Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How android app can detect what store installed it?

I have app in Google Play, Amazon, Samsung Apps and I plan to upload to other stores. I do not wish to compile separate build for every store. Is there way to detect what store installed app if same app submitted to different stores?

like image 599
Max Avatar asked Jul 13 '13 11:07

Max


1 Answers

You'll have to expand this for each additional store, but this should get you started

if (context.getPackageManager().getInstallerPackageName(context.getPackageName()).equals("com.android.vending")
{
//do google things
}
else if (context.getPackageManager().getInstallerPackageName(context.getPackageName()).equals("com.amazon.venezia")
{
//do amazon things
}
like image 61
prestomation Avatar answered Oct 11 '22 13:10

prestomation