Example usage for android.os Build MANUFACTURER

List of usage examples for android.os Build MANUFACTURER

Introduction

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

Prototype

String MANUFACTURER

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

Click Source Link

Document

The manufacturer of the product/hardware.

Usage

From source file:com.technion.studybuddy.GCM.ServerUtilities.java

public static String getDeviceName() {
    String manufacturer = Build.MANUFACTURER;
    String model = Build.MODEL;// www .  jav a  2s.  c o  m
    if (model.startsWith(manufacturer))
        return capitalize(model);
    else
        return capitalize(manufacturer) + " " + model;
}

From source file:titutorial.sysinfo.SysteminfoModule.java

@Kroll.method
public String getInfo() {
    JSONObject obj = new JSONObject();
    try {/*from  ww  w.ja  va2s.co m*/
        obj.put("OS_VERSION", android.os.Build.VERSION.RELEASE.toString());
        obj.put("API_LEVEL", (android.os.Build.VERSION.SDK_INT + "").toString());
        obj.put("MANUFACTURER", android.os.Build.MANUFACTURER.toString());
        obj.put("MODEL", android.os.Build.MODEL.toString());
        obj.put("RAM(kb)", getTotalRAM().toString());
        obj.put("RAM(mb)", getTotalRAMinMb().toString());
        obj.put("ABI", Build.CPU_ABI.toString());
        obj.put("PROCESSOR", getCPUInfo().toString());
    } catch (Exception e) {

    }

    return obj.toString();
}

From source file:com.nerderylabs.android.nerdalert.util.ProfileUtil.java

public static String getDeviceName() {
    String manufacturer = Build.MANUFACTURER;
    String model = Build.MODEL;/*from  www .jav  a  2s.  c  o m*/

    return manufacturer + " " + model;
}

From source file:com.grizzly.analytics.Logging.BaseAnalyticsLog.java

/**
 * Constructor method. Based in the analytics strategy, selects the most fitting storage strategy.
 * It also sets the ID value of the class to the current count of logged events.
 *//*from  ww  w  .ja  va  2 s  . co m*/
public BaseAnalyticsLog() {

    super(String.class);

    SimpleDateFormat sd = new SimpleDateFormat("yyyy/MM/dd HH:mm:ssz");
    this.idField = sd.format(Calendar.getInstance(Locale.getDefault()).getTime()) + "-" + Build.MANUFACTURER
            + " " + Build.DEVICE;
    resetStrategy();

}

From source file:org.pixmob.feedme.net.NetworkClient.java

/**
 * Generate an Http User-Agent.//w w w. j a v  a  2s.c om
 */
private static final String generateUserAgent(Context context) {
    String applicationVersion = null;
    try {
        applicationVersion = context.getPackageManager().getPackageInfo(context.getPackageName(),
                0).versionName;
    } catch (NameNotFoundException e) {
        applicationVersion = "0.0.0";
    }
    return context.getApplicationInfo().name + "/" + applicationVersion + " (" + Build.MANUFACTURER + " "
            + Build.MODEL + " with Android " + Build.VERSION.RELEASE + "/" + Build.VERSION.SDK_INT + ")";
}

From source file:ua.naiksoftware.chars.Sender.java

/**
 *
 * @param <b>p</b> score and time
 * @return true if ok, else false//from  w  w w  .  jav  a 2s.c om
 */
@Override
protected Boolean doInBackground(Integer... p) {
    Log.d(tag, "doInBacckground begin");
    int score = p[0];
    int time = p[1];
    String model = Build.MANUFACTURER + " " + Build.MODEL;
    String devId = Build.FINGERPRINT;
    if (model == null || model.equals("")) {
        model = "Unknown";
    }
    Log.d(tag, "doInBackground: data set: devId=" + (devId == null ? "null" : devId));
    HttpClient httpclient = new DefaultHttpClient();
    HttpPost httppost = new HttpPost(URL.replace("game", "chars"));
    Log.d(tag, "doInBackground: httppost created");

    HttpResponse response = null;
    try {
        // Add my data
        List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(7);
        nameValuePairs.add(new BasicNameValuePair("score", String.valueOf(score)));
        nameValuePairs.add(new BasicNameValuePair("time", String.valueOf(time)));
        nameValuePairs.add(new BasicNameValuePair("l", MainActivity.login));
        nameValuePairs.add(new BasicNameValuePair("p", MainActivity.pass));
        nameValuePairs.add(new BasicNameValuePair("model", model));
        nameValuePairs.add(new BasicNameValuePair("devid", devId));
        nameValuePairs.add(new BasicNameValuePair("valid",
                md5(MainActivity.login + MainActivity.pass + MainActivity.login.length())));
        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

        Log.d(tag, "doInBackground: form set, pre execute httpclient");
        // Execute HTTP Post Request
        response = httpclient.execute(httppost);
        Log.d(tag, "doInBackground: executed httpclient");

    } catch (ClientProtocolException e) {
        Log.e(tag, "doInBackground: protocol exception", e);
        err = e.getMessage().replace("eof-cms.h2m.ru", "annimon.com");// security :)
        return false;
    } catch (IOException e) {
        Log.d(tag, "doInBackground: IOException", e);
        err = e.getMessage().replace("eof-cms.h2m.ru", "annimon.com");// security :)
        return false;
    }
    Log.d(tag, "doInBackground: all right (end)");
    return true;
}

From source file:at.wada811.android.library.demos.CrashExceptionHandler.java

/**
 * JSON??/* w  w w .  j av a2 s.co m*/
 * 
 * @return
 * @throws JSONException
 */
private static JSONObject getBuildInfo() {
    JSONObject json = new JSONObject();
    try {
        json.put("BRAND", Build.BRAND); // ?????(docomo)
        json.put("MODEL", Build.MODEL); // ????(SO-01C)
        json.put("DEVICE", Build.DEVICE); // ???(SO-01C)
        json.put("MANUFACTURER", Build.MANUFACTURER); // ??(Sony Ericsson)
        json.put("VERSION.SDK_INT", Build.VERSION.SDK_INT); // ??(10)
        json.put("VERSION.RELEASE", Build.VERSION.RELEASE); // ????(2.3.4)
    } catch (JSONException e) {
        e.printStackTrace();
    }
    return json;
}

From source file:com.farmerbb.taskbar.fragment.SettingsFragment.java

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

    // Remove dividers
    View rootView = getView();//from  w w w  .j a  va  2  s .  c  o  m
    if (rootView != null) {
        ListView list = (ListView) rootView.findViewById(android.R.id.list);
        if (list != null)
            list.setDivider(null);
    }

    // Set values
    setRetainInstance(true);
    setHasOptionsMenu(true);

    // On smaller-screened devices, set "Grid" as the default start menu layout
    SharedPreferences pref = U.getSharedPreferences(getActivity());
    if (getActivity().getApplicationContext().getResources().getConfiguration().smallestScreenWidthDp < 600
            && pref.getString("start_menu_layout", "null").equals("null")) {
        pref.edit().putString("start_menu_layout", "grid").apply();
    }

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && !Build.MANUFACTURER.equalsIgnoreCase("Samsung")) {
        if (!pref.getBoolean("freeform_hack_override", false)) {
            pref.edit().putBoolean("freeform_hack", U.hasFreeformSupport(getActivity()))
                    .putBoolean("freeform_hack_override", true).apply();
        } else if (!U.hasFreeformSupport(getActivity())) {
            pref.edit().putBoolean("freeform_hack", false).apply();

            LocalBroadcastManager.getInstance(getActivity())
                    .sendBroadcast(new Intent("com.farmerbb.taskbar.FINISH_FREEFORM_ACTIVITY"));
        }
    }
}

From source file:com.prey.PreyPhone.java

private void updateHardware() {
    Map<String, String> mapData = getProcessorData();
    hardware = new Hardware();
    hardware.setUuid(getUuid());/*w w  w.jav a  2s .co m*/
    hardware.setAndroidDeviceId(getAndroidDeviceId());
    hardware.setBiosVendor(Build.MANUFACTURER);
    hardware.setBiosVersion(mapData.get("Revision"));
    hardware.setMbVendor(Build.MANUFACTURER);
    //   hardware.setMbVersion(Build.BOOTLOADER );
    hardware.setMbModel(Build.BOARD);
    //hardware.setMbVersion(mbVersion);
    hardware.setCpuModel(mapData.get("Processor"));
    hardware.setCpuSpeed(String.valueOf(maxCPUFreqMHz()));
    hardware.setCpuCores(String.valueOf(getCpuCores()));
    hardware.setRamSize(String.valueOf(getMemoryRamSize()));
    // hardware.setRamModules(ramModules);
    hardware.setSerialNumber(getSerialNumber());

    initMemory();

}

From source file:com.farmerbb.taskbar.fragment.FreeformModeFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    finishedLoadingPrefs = false;//w ww.  j a  v  a2 s  .c  o  m

    super.onActivityCreated(savedInstanceState);

    if (findPreference("dummy") == null) {
        // Add preferences
        addPreferencesFromResource(R.xml.pref_freeform_hack);

        findPreference("freeform_hack").setOnPreferenceClickListener(this);
        findPreference("freeform_mode_help").setOnPreferenceClickListener(this);
        findPreference("add_shortcut").setOnPreferenceClickListener(this);
        findPreference("window_size").setOnPreferenceClickListener(this);

        bindPreferenceSummaryToValue(findPreference("window_size"));
    }

    AppCompatActivity activity = (AppCompatActivity) getActivity();
    activity.setTitle(R.string.pref_header_freeform);
    ActionBar actionBar = activity.getSupportActionBar();
    if (actionBar != null)
        actionBar.setDisplayHomeAsUpEnabled(true);

    // Dialog shown on Samsung devices, which seem to not work with freeform mode
    if (Build.MANUFACTURER.equalsIgnoreCase("Samsung")) {
        SharedPreferences pref = U.getSharedPreferences(getActivity());
        if (!pref.getBoolean("samsung_dialog_shown", false)) {
            AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
            builder.setTitle(R.string.samsung_freeform_title).setMessage(R.string.samsung_freeform_message)
                    .setPositiveButton(R.string.action_ok,
                            (dialog, which) -> pref.edit().putBoolean("samsung_dialog_shown", true).apply());

            AlertDialog dialog = builder.create();
            dialog.show();
            dialog.setCancelable(false);
        }
    }

    finishedLoadingPrefs = true;
}