Android examples for android.os:Build
get Device Name
import android.os.Build; import java.util.HashMap; public class Main{ public static String getDeviceName() { String manufacturer = Build.MANUFACTURER; String model = Build.MODEL; if (model.startsWith(manufacturer)) { return capitalize(model); } else {//from w ww . jav a 2 s . c o m return capitalize(manufacturer) + " " + model; } } private static String capitalize(String s) { if (s == null || s.length() == 0) { return ""; } char first = s.charAt(0); if (Character.isUpperCase(first)) { return s; } else { return Character.toUpperCase(first) + s.substring(1); } } }