Example usage for android.os Build DEVICE

List of usage examples for android.os Build DEVICE

Introduction

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

Prototype

String DEVICE

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

Click Source Link

Document

The name of the industrial design.

Usage

From source file:net.heroicefforts.viable.android.BugReporterActivity.java

/**
 * Dumps the issue details collected by the system to a string.  Allow the user to see what will be submitted.
 * @param issue the defect/*  w  ww. ja  va  2s  . co  m*/
 * @return a pretty printed string of issue details.
 */
protected String formatDetails(Issue issue) {
    final String EOL = System.getProperty("line.separator");
    StringBuilder buf = new StringBuilder();
    buf.append(getString(R.string.app_label)).append(issue.getAppName()).append(EOL);
    if (issue instanceof BugContext) {
        if (issue.getAffectedVersions().length > 0)
            buf.append(getString(R.string.version_name)).append(issue.getAffectedVersions()[0]).append(EOL);
        buf.append(getString(R.string.phone_model)).append(Build.MODEL).append(EOL);
        buf.append(getString(R.string.phone_device)).append(Build.DEVICE).append(EOL);
        buf.append(getString(R.string.phone_sdk)).append(Build.VERSION.SDK_INT).append(EOL);
    }
    buf.append(getString(R.string.error)).append(issue.getStacktrace());

    return buf.toString();
}

From source file:com.github.chenxiaolong.dualbootpatcher.RomUtils.java

@NonNull
public static String getDeviceCodename(Context context) {
    return SystemPropertiesProxy.get(context, "ro.patcher.device", Build.DEVICE);
}

From source file:com.example.adarshgupta.wallpapertemplate.HomeActivity.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    super.onOptionsItemSelected(item);

    switch (item.getItemId()) {
    case R.id.share:
        Intent sharingIntent = new Intent(Intent.ACTION_SEND);
        sharingIntent.setType("text/plain");
        String shareBody = getResources().getString(R.string.share_one)
                + getResources().getString(R.string.iconpack_designer)
                + getResources().getString(R.string.share_two) + MARKET_URL + getPackageName();
        sharingIntent.putExtra(Intent.EXTRA_TEXT, shareBody);
        startActivity(Intent.createChooser(sharingIntent, (getResources().getString(R.string.share_title))));
        break;//from www .  j a v  a  2s.  c om

    case R.id.sendemail:
        StringBuilder emailBuilder = new StringBuilder();

        Intent intent = new Intent(Intent.ACTION_VIEW,
                Uri.parse("mailto:" + getResources().getString(R.string.email_id)));
        intent.putExtra(Intent.EXTRA_SUBJECT, getResources().getString(R.string.email_subject));

        emailBuilder.append("\n \n \nOS Version: ").append(System.getProperty("os.version")).append("(")
                .append(Build.VERSION.INCREMENTAL).append(")");
        emailBuilder.append("\nOS API Level: ").append(Build.VERSION.SDK_INT);
        emailBuilder.append("\nDevice: ").append(Build.DEVICE);
        emailBuilder.append("\nManufacturer: ").append(Build.MANUFACTURER);
        emailBuilder.append("\nModel (and Product): ").append(Build.MODEL).append(" (").append(Build.PRODUCT)
                .append(")");
        PackageInfo appInfo = null;
        try {
            appInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        assert appInfo != null;
        emailBuilder.append("\nApp Version Name: ").append(appInfo.versionName);
        emailBuilder.append("\nApp Version Code: ").append(appInfo.versionCode);

        intent.putExtra(Intent.EXTRA_TEXT, emailBuilder.toString());
        startActivity(Intent.createChooser(intent, (getResources().getString(R.string.send_title))));
        break;

    case R.id.changelog:
        showChangelog();
        break;
    }
    return true;
}

From source file:com.knightlabs.orion_base.activities.Main.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    super.onOptionsItemSelected(item);

    switch (item.getItemId()) {
    case R.id.share:
        Intent sharingIntent = new Intent(Intent.ACTION_SEND);
        sharingIntent.setType("text/plain");
        String shareBody = "Check out this awesome icon pack by "
                + getResources().getString(R.string.orion_author) + ". Download Here: "
                + getResources().getString(R.string.website_link);
        sharingIntent.putExtra(Intent.EXTRA_TEXT, shareBody);
        startActivity(Intent.createChooser(sharingIntent, (getResources().getString(R.string.share_title))));
        break;//from ww w  .  j  a  v a2  s  .c o m

    case R.id.sendemail:
        StringBuilder emailBuilder = new StringBuilder();

        Intent intent = new Intent(Intent.ACTION_VIEW,
                Uri.parse("mailto:" + getResources().getString(R.string.email_id)));
        intent.putExtra(Intent.EXTRA_SUBJECT, getResources().getString(R.string.email_subject));

        emailBuilder.append("\n \n \nOS Version: " + System.getProperty("os.version") + "("
                + Build.VERSION.INCREMENTAL + ")");
        emailBuilder.append("\nOS API Level: " + Build.VERSION.SDK_INT);
        emailBuilder.append("\nDevice: " + Build.DEVICE);
        emailBuilder.append("\nManufacturer: " + Build.MANUFACTURER);
        emailBuilder.append("\nModel (and Product): " + Build.MODEL + " (" + Build.PRODUCT + ")");
        PackageInfo appInfo = null;
        try {
            appInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        emailBuilder.append("\nApp Version Name: " + appInfo.versionName);
        emailBuilder.append("\nApp Version Code: " + appInfo.versionCode);

        intent.putExtra(Intent.EXTRA_TEXT, emailBuilder.toString());
        startActivity(Intent.createChooser(intent, (getResources().getString(R.string.send_title))));
        break;

    case R.id.changelog:
        changelog();
        break;
    }
    return true;
}

From source file:com.pimp.companionforband.activities.main.MainActivity.java

@Override
public void onNegativeReview(int stars) {
    StringBuilder emailBuilder = new StringBuilder();
    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("mailto:pimplay69@gmail.com"));
    intent.putExtra(Intent.EXTRA_SUBJECT,
            getString(R.string.feedback) + " : " + getResources().getString(R.string.app_name));

    emailBuilder.append("\n \n \nOS Version: ").append(System.getProperty("os.version")).append("(")
            .append(Build.VERSION.INCREMENTAL).append(")");
    emailBuilder.append("\nOS API Level: ").append(Build.VERSION.SDK_INT);
    emailBuilder.append("\nDevice: ").append(Build.DEVICE);
    emailBuilder.append("\nManufacturer: ").append(Build.MANUFACTURER);
    emailBuilder.append("\nModel (and Product): ").append(Build.MODEL).append(" (").append(Build.PRODUCT)
            .append(")");
    PackageInfo appInfo = null;/*from w  w w .ja v  a  2  s . co m*/
    try {
        appInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
    } catch (PackageManager.NameNotFoundException e) {
        e.printStackTrace();
    }
    assert appInfo != null;
    emailBuilder.append("\nApp Version Name: ").append(appInfo.versionName);
    emailBuilder.append("\nApp Version Code: ").append(appInfo.versionCode);

    intent.putExtra(Intent.EXTRA_TEXT, emailBuilder.toString());
    startActivity(Intent.createChooser(intent, "Send via"));
}

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. ja  va 2s  .  c om
            "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:com.kdb.ledcontrol.LEDManager.java

public String getDevice() {
    if (deviceInput == null || deviceOutput == null)
        return null;
    String device = null;//from   w  w  w. java 2  s  .  c om
    String output = Build.DEVICE;
    if (output.contains(DEVICE_MOTO_E))
        device = DEVICE_MOTO_E;
    else if (output.contains(DEVICE_MOTO_G))
        device = DEVICE_MOTO_G;
    else if (output.contains(DEVICE_MOTO_X))
        device = DEVICE_MOTO_X;
    else if (output.contains(DEVICE_NEXUS_6))
        device = DEVICE_NEXUS_6;
    else if (output.contains(DEVICE_MAXX))
        device = DEVICE_MAXX;
    else if (output.contains(DEVICE_ULTRA))
        device = DEVICE_ULTRA;
    return device;
}

From source file:com.bt.download.android.gui.Librarian.java

public Finger finger(boolean local) {
    Finger finger = new Finger();

    finger.uuid = ConfigurationManager.instance().getUUIDString();
    finger.nickname = ConfigurationManager.instance().getNickname();
    finger.frostwireVersion = Constants.FROSTWIRE_VERSION_STRING;
    finger.totalShared = getNumFiles();/*from   www  .  j a v a 2s  . co  m*/

    finger.deviceVersion = Build.VERSION.RELEASE;
    finger.deviceModel = Build.MODEL;
    finger.deviceProduct = Build.PRODUCT;
    finger.deviceName = Build.DEVICE;
    finger.deviceManufacturer = Build.MANUFACTURER;
    finger.deviceBrand = Build.BRAND;
    finger.deviceScreen = readScreenMetrics();

    finger.numSharedAudioFiles = getNumFiles(Constants.FILE_TYPE_AUDIO, true);
    finger.numSharedVideoFiles = getNumFiles(Constants.FILE_TYPE_VIDEOS, true);
    finger.numSharedPictureFiles = getNumFiles(Constants.FILE_TYPE_PICTURES, true);
    finger.numSharedDocumentFiles = getNumFiles(Constants.FILE_TYPE_DOCUMENTS, true);
    finger.numSharedApplicationFiles = getNumFiles(Constants.FILE_TYPE_APPLICATIONS, true);
    finger.numSharedRingtoneFiles = getNumFiles(Constants.FILE_TYPE_RINGTONES, true);

    if (local) {
        finger.numTotalAudioFiles = getNumFiles(Constants.FILE_TYPE_AUDIO, false);
        finger.numTotalVideoFiles = getNumFiles(Constants.FILE_TYPE_VIDEOS, false);
        finger.numTotalPictureFiles = getNumFiles(Constants.FILE_TYPE_PICTURES, false);
        finger.numTotalDocumentFiles = getNumFiles(Constants.FILE_TYPE_DOCUMENTS, false);
        finger.numTotalApplicationFiles = getNumFiles(Constants.FILE_TYPE_APPLICATIONS, false);
        finger.numTotalRingtoneFiles = getNumFiles(Constants.FILE_TYPE_RINGTONES, false);
    } else {
        finger.numTotalAudioFiles = finger.numSharedAudioFiles;
        finger.numTotalVideoFiles = finger.numSharedVideoFiles;
        finger.numTotalPictureFiles = finger.numSharedPictureFiles;
        finger.numTotalDocumentFiles = finger.numSharedDocumentFiles;
        finger.numTotalApplicationFiles = finger.numSharedApplicationFiles;
        finger.numTotalRingtoneFiles = finger.numSharedRingtoneFiles;
    }

    return finger;
}

From source file:fr.simon.marquis.secretcodes.ui.MainActivity.java

private String generateEmailBody(ArrayList<SecretCode> secretCodes) {
    StringBuilder sb = new StringBuilder(getString(R.string.extra_text)) //
            .append("DEVICE_MANUFACTURER  ").append(Build.MANUFACTURER)//
            .append("\nDEVICE_MODEL  ").append(Build.MODEL)//
            .append("\nDEVICE_CODE_NAME  ").append(Build.DEVICE)//
            .append("\nDEVICE_LOCALE  ").append(Locale.getDefault().getDisplayName())//
            .append("\nANDROID_VERSION  ").append(Build.VERSION.RELEASE)//
            .append("\n\n");

    for (SecretCode secretCode : secretCodes) {
        sb.append(secretCode.getCode()).append("  ").append(secretCode.getLabel()).append("\n  \n\n");
    }/*from  w  w w  .jav a 2s .  c o m*/
    return sb.append(getString(R.string.extra_text_end)).toString();
}

From source file:com.cc.signalinfo.activities.MainActivity.java

/**
 * Set the phone model, OS version, carrier name on the screen
 *///from  w  w w .j  a v a 2s.  co m
private void setPhoneInfo() {
    setTextViewText(R.id.deviceName, String.format("%s %s", Build.MANUFACTURER, Build.MODEL));
    setTextViewText(R.id.deviceModel, String.format("%s/%s (%s) ", Build.PRODUCT, Build.DEVICE, Build.ID));
    setTextViewText(R.id.androidVersion,
            String.format(getString(R.string.androidVersion), Build.VERSION.RELEASE, Build.VERSION.SDK_INT));

    setTextViewText(R.id.carrierName, tm.getNetworkOperatorName());
    setTextViewText(R.id.buildHost, Build.HOST);
    setNetworkTypeText();
}