Search code examples
androiddevicesamsung-mobile

How to make applications run only on one type of android device?


Today, i have a question and need to help. Is there a way to make an android application run only on some type of device ? (Like it run only in Samsung or Sony device..) And how to do it?

Thanks for help !


Solution

  • you can do this with the help of following code....

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

    and then :

     if (
    
        manufactures == "Samsung" || "samsung")
       {
    
        Log.d ("device","This device manufactured from samsung");
    }
    
        else {
    
        Log.d ("device","This device not manufactured from samsung Sorry!!!");
    }