如何查找设备类型和其他有关设备的信息

How to find the device type and other information about device

我想创建一个只能在 'Samsung' 或 'Micromax' 等特定设备类型上运行的应用程序,那么如何在我的代码中找到它。可能吗?

这对我的应用程序很有用,请给我建议解决方案。提前致谢

String manufacturer = Build.MANUFACTURER; //this one will work for you.
String product = Build.PRODUCT;
String model = Build.MODEL;

如有任何问题请告诉我

您应该使用 Build class,例如:

public boolean isSamsung()
    {
        String manufacturer = android.os.Build.MANUFACTURER;
        if (manufacturer.toLowerCase(Locale.ENGLISH).contains("samsung"))
            return true;
        else
            return false;
    }

您可以使用 Build Class 来达到这个目的。

String BrandName = android.os.Build.MANUFACTURE;      // Manufacturer will come I think, Correct me if I am wrong :)  Brand name like Samsung or Mircomax

String myDeviceModel = android.os.Build.MODEL;
String SDKName = android.os.Build.VERSION.SDK      // API Level
String DeviceName = android.os.Build.DEVICE           // Device
String DeviceModel = android.os.Build.MODEL            // Model 
String Productname = android.os.Build.PRODUCT          // Product

有关更多信息,请转到 this link.