Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.os.Build; import android.util.DisplayMetrics; import java.util.LinkedHashMap; import java.util.Map; public class Main { public static String getDeviceInfos(Context context) { Map<String, String> infos = new LinkedHashMap<>(); DisplayMetrics dm = context.getResources().getDisplayMetrics(); int densityDpi = dm.densityDpi; infos.put("API Level", String.valueOf(Build.VERSION.SDK_INT)); infos.put("OS Version", Build.VERSION.RELEASE); infos.put("Model", Build.MODEL); infos.put("Manufacturer", Build.MANUFACTURER); infos.put("Brand", Build.BRAND); infos.put("Device / Product", Build.DEVICE + " / " + Build.PRODUCT); infos.put("Kernel-Version", System.getProperty("os.version")); StringBuilder sb = new StringBuilder(); sb.append("<table class=\"table table-striped\">"); sb.append("<tbody>"); for (Map.Entry<String, String> deviceInfo : infos.entrySet()) { sb.append("<tr><th>"); sb.append(deviceInfo.getKey()); sb.append("</th><td>"); sb.append(deviceInfo.getValue()); sb.append("</td></tr>"); } sb.append("<tbody>"); sb.append("</table>"); return sb.toString(); } }