Example usage for android.os Build DISPLAY

List of usage examples for android.os Build DISPLAY

Introduction

In this page you can find the example usage for android.os Build DISPLAY.

Prototype

String DISPLAY

To view the source code for android.os Build DISPLAY.

Click Source Link

Document

A build ID string meant for displaying to the user

Usage

From source file:com.appbackr.android.tracker.Tracker.java

/**
  * Generates a unique ID for the device.
  * /* www.  j  a va2 s.  c  o  m*/
  * This function obtain the Unique ID from the phone. The Unique ID consist of
  *    Build.BOARD + Build.BRAND + Build.CPU_ABI
  *    + Build.DEVICE + Build.DISPLAY + Build.FINGERPRINT + Build.HOST
  *    + Build.ID + Build.MANUFACTURER + Build.MODEL + Build.PRODUCT
  *    + Build.TAGS + Build.TYPE + Build.USER;
  *    + IMEI (GSM) or MEID/ESN (CDMA)
  *    + Android-assigned id
  * 
  * The Android ID may be changed everytime the user perform Factory Reset
  * I heard that IMEI values might not be unique because phone factory
  * might reuse IMEI values to cut cost.
  * 
  * While the ID might be different from the same device, but resetting of the
  * Android phone should not occur that often. The values should be close 
  * enough.
  *
  * @param c android application contact 
  * @return unique ID as md5 hash generated of available parameters from device and cell phone service provider
  */
 private static String getUDID(Context c) {

     // Get some of the hardware information
     String buildParams = Build.BOARD + Build.BRAND + Build.CPU_ABI + Build.DEVICE + Build.DISPLAY
             + Build.FINGERPRINT + Build.HOST + Build.ID + Build.MANUFACTURER + Build.MODEL + Build.PRODUCT
             + Build.TAGS + Build.TYPE + Build.USER;

     // Requires READ_PHONE_STATE
     TelephonyManager tm = (TelephonyManager) c.getSystemService(Context.TELEPHONY_SERVICE);

     // gets the imei (GSM) or MEID/ESN (CDMA)
     String imei = tm.getDeviceId();

     // gets the android-assigned id
     String androidId = Secure.getString(c.getContentResolver(), Secure.ANDROID_ID);

     // concatenate the string
     String fullHash = buildParams.toString() + imei + androidId;

     return md5(fullHash);
 }

From source file:com.android.tv.settings.about.AboutFragment.java

@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
    setPreferencesFromResource(R.xml.device_info_settings, null);
    final PreferenceScreen screen = getPreferenceScreen();

    refreshDeviceName();// ww w  .  j ava2  s.  c o m
    final Preference deviceNamePref = findPreference(KEY_DEVICE_NAME);
    PreferenceUtils.resolveSystemActivityOrRemove(getActivity(), screen, deviceNamePref, 0);

    final Preference firmwareVersionPref = findPreference(KEY_FIRMWARE_VERSION);
    firmwareVersionPref.setSummary(Build.VERSION.RELEASE);
    firmwareVersionPref.setEnabled(true);

    final Preference securityPatchPref = findPreference(KEY_SECURITY_PATCH);
    final String patch = DeviceInfoUtils.getSecurityPatch();
    if (!TextUtils.isEmpty(patch)) {
        securityPatchPref.setSummary(patch);
    } else {
        removePreference(securityPatchPref);
    }

    final LongClickPreference restartPref = (LongClickPreference) findPreference(KEY_RESTART);
    restartPref.setLongClickListener(this);

    findPreference(KEY_BASEBAND_VERSION)
            .setSummary(getSystemPropertySummary(TelephonyProperties.PROPERTY_BASEBAND_VERSION));
    findPreference(KEY_DEVICE_MODEL).setSummary(Build.MODEL + DeviceInfoUtils.getMsvSuffix());
    findPreference(KEY_EQUIPMENT_ID).setSummary(getSystemPropertySummary(PROPERTY_EQUIPMENT_ID));

    final Preference buildNumberPref = findPreference(KEY_BUILD_NUMBER);
    buildNumberPref.setSummary(Build.DISPLAY);
    buildNumberPref.setEnabled(true);
    findPreference(KEY_KERNEL_VERSION).setSummary(DeviceInfoUtils.getFormattedKernelVersion());

    final Preference selinuxPref = findPreference(KEY_SELINUX_STATUS);
    if (!SELinux.isSELinuxEnabled()) {
        selinuxPref.setSummary(R.string.selinux_status_disabled);
    } else if (!SELinux.isSELinuxEnforced()) {
        selinuxPref.setSummary(R.string.selinux_status_permissive);
    }

    // Remove selinux information if property is not present
    if (TextUtils.isEmpty(SystemProperties.get(PROPERTY_SELINUX_STATUS))) {
        removePreference(selinuxPref);
    }

    // Remove Safety information preference if PROPERTY_URL_SAFETYLEGAL is not set
    if (TextUtils.isEmpty(SystemProperties.get(PROPERTY_URL_SAFETYLEGAL))) {
        removePreference(findPreference(KEY_SAFETY_LEGAL));
    }

    // Remove Equipment id preference if FCC ID is not set by RIL
    if (TextUtils.isEmpty(SystemProperties.get(PROPERTY_EQUIPMENT_ID))) {
        removePreference(findPreference(KEY_EQUIPMENT_ID));
    }

    // Remove Baseband version if wifi-only device
    if (isWifiOnly(getActivity())) {
        removePreference(findPreference(KEY_BASEBAND_VERSION));
    }

    // Dont show feedback option if there is no reporter.
    if (TextUtils.isEmpty(DeviceInfoUtils.getFeedbackReporterPackage(getActivity()))) {
        removePreference(findPreference(KEY_DEVICE_FEEDBACK));
    }

    final Preference updateSettingsPref = findPreference(KEY_SYSTEM_UPDATE_SETTINGS);
    if (mUm.isAdminUser()) {
        PreferenceUtils.resolveSystemActivityOrRemove(getActivity(), screen, updateSettingsPref,
                PreferenceUtils.FLAG_SET_TITLE);
    } else if (updateSettingsPref != null) {
        // Remove for secondary users
        removePreference(updateSettingsPref);
    }

    // Read platform settings for additional system update setting
    if (!getResources().getBoolean(R.bool.config_additional_system_update_setting_enable)) {
        removePreference(findPreference(KEY_UPDATE_SETTING));
    }

    // Remove manual entry if none present.
    if (!getResources().getBoolean(R.bool.config_show_manual)) {
        removePreference(findPreference(KEY_MANUAL));
    }

    // Remove regulatory information if none present.
    final Preference regulatoryPref = findPreference(KEY_REGULATORY_INFO);
    PreferenceUtils.resolveSystemActivityOrRemove(getActivity(), screen, regulatoryPref, 0);
}

From source file:net.sylvek.sharemyposition.ShareMyPosition.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    HttpProtocolParams.setUserAgent(params, "Android/" + Build.DISPLAY + "/version:" + VERSION);

    gc = new Geocoder(this);

    connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);

    telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

    pref = PreferenceManager.getDefaultSharedPreferences(this);

    tips = getResources().getStringArray(R.array.tips);

    sharedMap = new MapView(ShareMyPosition.this, MapViewMode.MAPNIK_TILE_DOWNLOAD);
    sharedMap.setClickable(true);//from   ww w .j a  v  a 2s  . c  om
    sharedMap.setAlwaysDrawnWithCacheEnabled(true);
    sharedMap.setFocusable(true);
    sharedMap.getOverlays().add(new CenterOverlay(sharedMap));
}

From source file:com.tassadar.multirommgr.installfragment.InstallCard.java

private int getDefaultKernel() {
    int res = 0;/*from w w w.ja v a2s  .  co  m*/
    Iterator<Map.Entry<String, Manifest.InstallationFile>> itr = m_manifest.getKernels().entrySet().iterator();
    for (int i = 0; itr.hasNext(); ++i) {
        JSONObject extra = itr.next().getValue().extra;
        if (extra == null)
            continue;
        try {
            if (extra.has("display") && Build.DISPLAY.indexOf(extra.getString("display")) == -1)
                continue;

            if (extra.has("releases")) {
                JSONArray r = extra.getJSONArray("releases");
                boolean found = false;
                for (int x = 0; x < r.length(); ++x) {
                    if (r.getString(x).equals(Build.VERSION.RELEASE)) {
                        found = true;
                        break;
                    }
                }
                if (!found)
                    continue;
            }
            res = i;
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }
    return res;
}

From source file:com.dubsar_dictionary.Dubsar.model.Model.java

private static HttpClient newClient() {
    String userAgent = getString(R.string.user_agent);
    userAgent += " ("
            + getContext().getString(R.string.android_version, new Object[] { Build.VERSION.RELEASE });
    userAgent += "; " + getContext().getString(R.string.build, new Object[] { Build.DISPLAY });
    userAgent += ")";

    HttpClient client = AndroidHttpClient.newInstance(userAgent, getContext());
    HttpClientParams.setRedirecting(client.getParams(), true);

    return client;
}

From source file:de.schildbach.wallet.ui.ReportIssueDialogFragment.java

private static void appendDeviceInfo(final Appendable report, final Context context) throws IOException {
    final Resources res = context.getResources();
    final android.content.res.Configuration config = res.getConfiguration();
    final ActivityManager activityManager = (ActivityManager) context
            .getSystemService(Context.ACTIVITY_SERVICE);
    final DevicePolicyManager devicePolicyManager = (DevicePolicyManager) context
            .getSystemService(Context.DEVICE_POLICY_SERVICE);

    report.append("Device Model: " + Build.MODEL + "\n");
    report.append("Android Version: " + Build.VERSION.RELEASE + "\n");
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
        report.append("Android security patch level: ").append(Build.VERSION.SECURITY_PATCH).append("\n");
    report.append("ABIs: ")
            .append(Joiner.on(", ").skipNulls()
                    .join(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? supportedAbisLollipop()
                            : supportedAbisKitKat()))
            .append("\n");
    report.append("Board: " + Build.BOARD + "\n");
    report.append("Brand: " + Build.BRAND + "\n");
    report.append("Device: " + Build.DEVICE + "\n");
    report.append("Display: " + Build.DISPLAY + "\n");
    report.append("Finger Print: " + Build.FINGERPRINT + "\n");
    report.append("Host: " + Build.HOST + "\n");
    report.append("ID: " + Build.ID + "\n");
    report.append("Product: " + Build.PRODUCT + "\n");
    report.append("Tags: " + Build.TAGS + "\n");
    report.append("Time: " + Build.TIME + "\n");
    report.append("Type: " + Build.TYPE + "\n");
    report.append("User: " + Build.USER + "\n");
    report.append("Configuration: " + config + "\n");
    report.append("Screen Layout: size "
            + (config.screenLayout & android.content.res.Configuration.SCREENLAYOUT_SIZE_MASK) + " long "
            + (config.screenLayout & android.content.res.Configuration.SCREENLAYOUT_LONG_MASK) + "\n");
    report.append("Display Metrics: " + res.getDisplayMetrics() + "\n");
    report.append(/*from  www.j a  va 2s .com*/
            "Memory Class: " + activityManager.getMemoryClass() + "/" + activityManager.getLargeMemoryClass()
                    + (activityManager.isLowRamDevice() ? " (low RAM device)" : "") + "\n");
    report.append("Storage Encryption Status: " + devicePolicyManager.getStorageEncryptionStatus() + "\n");
    report.append("Bluetooth MAC: " + bluetoothMac() + "\n");
    report.append("Runtime: ").append(System.getProperty("java.vm.name")).append(" ")
            .append(System.getProperty("java.vm.version")).append("\n");
}

From source file:mx.klozz.xperience.tweaker.MainActivity.java

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if ((requestCode == 1) && (resultCode == RESULT_OK)) {
        String r = data.getStringExtra("r");
        if (r != null && r.equals("ok")) {
            mPreferences.edit().putString("rom", Build.DISPLAY).commit();
            getCPUvalues();//from   w  w  w .j  a  v a 2s . c  o  m
            mViewPager.setAdapter(titleAdapter);
            mViewPager.setCurrentItem(0);//El item que queremos que sea el primero en mostrar
            return;
        }
    }
    finish();
}

From source file:com.www.avtovokzal.org.MainActivity.java

private void sendPhoneInformationToServer() {
    String version = null;//ww  w  .ja va 2 s  .  c om
    PackageInfo packageInfo = null;

    try {
        packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
    } catch (PackageManager.NameNotFoundException e) {
        e.printStackTrace();
    }

    String manufacturer = Uri.encode(Build.MANUFACTURER);
    String model = Uri.encode(Build.MODEL);
    String device = Uri.encode(Build.DEVICE);
    String board = Uri.encode(Build.BOARD);
    String brand = Uri.encode(Build.BRAND);
    String display = Uri.encode(Build.DISPLAY);
    String id = Uri.encode(Build.ID);
    String product = Uri.encode(Build.PRODUCT);
    String release = Uri.encode(Build.VERSION.RELEASE);

    if (packageInfo != null) {
        version = Uri.encode(packageInfo.versionName);
    }

    if (Constants.LOG_ON) {
        Log.v(TAG, "1: " + manufacturer + " 2: " + model + " 3: " + device + " 4: " + board + " 5: " + brand
                + " 6: " + display + " 7: " + id + " 8: " + product + " 9: " + release + " 10: " + version);
    }

    String url = "http://www.avtovokzal.org/php/app/sendPhoneInformation.php?manufacturer=" + manufacturer
            + "&model=" + model + "&device=" + device + "&board=" + board + "&brand=" + brand + "&display="
            + display + "&build_id=" + id + "&product=" + product + "&release_number=" + release + "&version="
            + version;

    if (isOnline()) {
        StringRequest strReq = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {
            @Override
            public void onResponse(String response) {
            }
        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                if (Constants.LOG_ON)
                    VolleyLog.d(TAG, "Error: " + error.getMessage());
            }
        });
        // ? TimeOut, Retry
        strReq.setRetryPolicy(new DefaultRetryPolicy(DefaultRetryPolicy.DEFAULT_TIMEOUT_MS, 3,
                DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
        // ? ?  
        AppController.getInstance().addToRequestQueue(strReq);
    } else {
        callErrorActivity();
    }
}