【问题标题】:How to find the device type and other information about device如何查找设备类型和有关设备的其他信息
【发布时间】:2016-03-13 04:13:43
【问题描述】:

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

这对我的应用程序很有用,请向我推荐解决方案。在此先感谢

【问题讨论】:

  • 接受一个正确答案,否则问题仍显示为未回答。

标签: android device


【解决方案1】:

您应该使用Build 类,例如:

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

【讨论】:

    【解决方案2】:

    您可以为此目的使用Build 类。

    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.

    【讨论】:

      【解决方案3】:
      String manufacturer = Build.MANUFACTURER; //this one will work for you.
      String product = Build.PRODUCT;
      String model = Build.MODEL;
      

      如果有任何问题请告诉我

      【讨论】:

        猜你喜欢
        • 2010-12-03
        • 1970-01-01
        • 2018-05-19
        • 1970-01-01
        • 2016-01-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多