In my app, I'm recommending related apps, but only want to recommend them if they actually can be installed on the device (e.g. device in related apps' targeted countries, correct OS version, etc.). See https://developer.android.com/google/play/filters.html
Below the Install link, you'll see a green message that lets you know this particular app is compatible, incompatible or partially compatible with your device or devices. Click on the “+” to reveal the compatibility details for the app or game.
Try this google official api: github.com/googlesamples/android-play-publisher-api/tree/master/…
Call the method isPackageInstalled() : boolean isAppInstalled = isPackageInstalled("com. android. app" , this.
You can Find the List of installed apps in Android Device by using below code, "packageInfo" Contains Installed Application Information in Device. we can retrive Intent for the application installed from the packageinfo object and by using startactivity(intent), can start application.
Unfortunately, there is no API to compare an app with specific devices. The Play Store is it doing somehow internally.
So, the second approach is the way to go. The most common filters are
Country (since you can't retrieve the "play store country", use other approaches...)
String locale = context.getResources().getConfiguration().locale.getCountry();
// or if you are sure there is a SIM-card
TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
String countryCode = tm.getSimCountryIso();
// or use country of current network (i.e. from 3G)
String countryCode = tm.getNetworkCountryIso()
Android version
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD) {
// only for gingerbread and newer versions
}
Screen size
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;
int height = size.y;
You may want to check other things like the available sensors (which you could do via getSensorList
). To list them all would create a very long list and finding all APIs to find these things is mostly easy, so I won't list them all.
By checking country, version and screen size you should be safe with most of the apps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With