Is there a reliable way of detecting if device is one from Samsung Galaxy phones? Currently, I do it in this way:
private static boolean isSamsungGalaxyN() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
try {
PackageInfo info = getContext().getPackageManager().getPackageInfo("com.samsung.android.app.galaxyfinder", 0);
if (info != null) {
return true;
}
} catch (PackageManager.NameNotFoundException e) {
// ignored
}
}
return false;
}
So, I just check if there is such apk (which is S Finder, actually):
com.samsung.android.app.galaxyfinder
But is this method reliable and is there some better method?