0

今天,我有一个问题,需要帮助。有没有办法让安卓应用程序只在某种类型的设备上运行?(就像它只在三星或索尼设备上运行..)那怎么做?

感谢帮助 !

4

1 回答 1

-1

您可以在以下代码的帮助下做到这一点......

public String getDeviceName() {
  String manufacturer = Build.MANUFACTURER;
  String model = Build.MODEL;
  if (model.startsWith(manufacturer)) {
    return capitalize(model);
  } else {
    return capitalize(manufacturer) + " " + model;
  }
}

接着 :

 if (

    manufactures == "Samsung" || "samsung")
   {

    Log.d ("device","This device manufactured from samsung");
}

    else {

    Log.d ("device","This device not manufactured from samsung Sorry!!!");
}
于 2013-08-10T03:30:13.610 回答