get Terminal Brand - Android android.os

Android examples for android.os:Build

Description

get Terminal Brand

Demo Code

import android.text.TextUtils;

public class Main {

  /**/* w  ww  . j  av  a 2  s .c  o m*/
   * get device brand
   * 
   * @return android.os.Build.BRAND
   */
  public static String getTerminalBrand() {
    String brand;
    try {
      brand = android.os.Build.BRAND;
      if (TextUtils.isEmpty(brand)) {
        Class<android.os.Build> build_class = android.os.Build.class;
        java.lang.reflect.Field field;
        field = build_class.getField("BRAND");
        brand = (String) field.get(new android.os.Build());
      }
    } catch (Exception e) {
      e.printStackTrace();
      brand = "";
    }
    return brand;
  }

}

Related Tutorials