Reputation: 1919
I want to create an application which should only work on particular device type like 'Samsung' or 'Micromax',So how can I find it in my code. Is it possible?
It would be useful for my application please suggest me the solution. Thanks in advance
Upvotes: 1
Views: 3382
Reputation: 4324
You can use Build
Class for this purpose.
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
For More Info goto this link.
Upvotes: 2
Reputation: 50036
You should use Build
class, ex:
public boolean isSamsung()
{
String manufacturer = android.os.Build.MANUFACTURER;
if (manufacturer.toLowerCase(Locale.ENGLISH).contains("samsung"))
return true;
else
return false;
}
Upvotes: 3
Reputation: 1422
String manufacturer = Build.MANUFACTURER; //this one will work for you.
String product = Build.PRODUCT;
String model = Build.MODEL;
let me know if any issue
Upvotes: 1