Jim Raynor Jim Raynor - 5 months ago 27
Android Question

How to get the device Model Name?

How to get the device model name ? I have a Yuphoria 5010 which displays YU5010 in device Model Number, I want to fetch the full name of the device? I want the fetch the exact string given below:


Yuphoria 5010 6.0 Marshmallow

Answer

It was really simple, just call:

String model = Build.MODEL;

Update: This code will print the exact string you requested:

String reqString = Build.MANUFACTURER
                + " " + Build.MODEL + " " + Build.VERSION.RELEASE
                + " " + Build.VERSION_CODES.class.getFields()[android.os.Build.VERSION.SDK_INT].getName();

Prints:

Samsung Note 4 6.0 MARSHMALLOW

LGE LG-D410 4.4.2 KITKAT