简体   繁体   中英

How to execute different code based on the device manufacturers?

I want to execute different codes for different device manufacturers.

I know I can do it by using Build.MODEL and then check which model is that user using.

But the main problem is suppose

LG Optimus Zone 3 would return VS425PP

Samsung J7 Prime would return J7 Prime

Samsung J7 2016 Edition would return SM-J710F

ZTE Z798BL would return Z798BL

In the above cases is would be difficult to find out which manufacturer does that device belong to.

Can Any one please help with this.

Why don't you just read it from android.os.Build.Manufacturer or android.os.Build.Brand? https://developer.android.com/reference/android/os/Build.html?hl=ja

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM