How to detect a mobile device manufacturer and model programmatically in Android?

假装没事ソ 提交于 2019-11-30 01:10:44

You can get as below:

String deviceName = android.os.Build.MODEL;
String deviceMan = android.os.Build.MANUFACTURER;

For more other device details, Please refer this document: android.os.Build

I just wanna elaborate on how to use the built in Attribute for the future visitors. You can use this method in identifying a Kindle Device(s)

public static boolean isKindle(){
        final String AMAZON = "Amazon";
        final String KINDLE_FIRE = "Kindle Fire";

        return (Build.MANUFACTURER.equals(AMAZON) && Build.MODEL.equals(KINDLE_FIRE) ) || Build.MODEL.startsWith("KF");
} 
String deviceName = android.os.Build.MODEL;
String deviceMan = android.os.Build.MANUFACTURER;

The original solution will work fine, however it will not detect a custom ROM (non OEM) in call cases. You may want to also evaluate the android.os.Build.PRODUCT string or other strings from the Build class.

String build = android.os.Build.PRODUCT;
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!