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.cc.signalinfo.activities.MainActivity.java

/**
 * Set the phone model, OS version, carrier name on the screen
 *///from   w w  w.  ja  va2 s.com
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();
}

From source file:com.sidekickApp.AppState.java

public AppState() {
    mapCentered = false;//from www  .j  a  v a 2  s. c o  m
    currentApiVersion = android.os.Build.VERSION.SDK_INT;
    froyoApiVersion = android.os.Build.VERSION_CODES.FROYO;
    deviceMakeModel = Build.MANUFACTURER + " " + Build.MODEL;

    log("currentApiVersion = " + currentApiVersion + ", froyoApiVersion = " + froyoApiVersion
            + ", deviceMakeModel = " + deviceMakeModel);

    String prefix = "http";
    String suffix = ":";

    //represents ApiLevel 8, Android 2.2 & below = deprecation town
    /*
    if(currentApiVersion > froyoApiVersion)
    {
       // We can connect over https
       IS_SECURE = true;
       prefix += "s";
       suffix += "8081/";
    }
    else
    {
       // Cannot connect over https.
    */ IS_SECURE = false;
    suffix += "8080/";
    //}
    prefix += "://";

    devSocketUrl = prefix + devSocketUrl + suffix;
    devWebUrl = prefix + devWebUrl;
    productionSocketUrl = prefix + productionSocketUrl + suffix;
    productionWebUrl = prefix + productionWebUrl;
}

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

private void sendPhoneInformationToServer() {
    String version = null;/*  w  w  w . j av a  2  s . c  o m*/
    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();
    }
}

From source file:com.stfalcon.contentmanager.ContentManager.java

/**
 * Check device model and return is need to set predefined camera uri
 *///from   ww w .  j  a v  a2s.  co  m
private boolean isSetPreDefinedCameraUri() {
    boolean setPreDefinedCameraUri = false;

    // NOTE: Do NOT SET: intent.putExtra(MediaStore.EXTRA_OUTPUT, cameraPicUri)
    // on Samsung Galaxy S2/S3/.. for the following reasons:
    // 1.) it will break the correct picture orientation
    // 2.) the photo will be stored in two locations (the given path and, additionally, in the MediaStore)
    String manufacturer = Build.MANUFACTURER.toLowerCase(Locale.ENGLISH);
    String model = Build.MODEL.toLowerCase(Locale.ENGLISH);
    String buildType = Build.TYPE.toLowerCase(Locale.ENGLISH);
    String buildDevice = Build.DEVICE.toLowerCase(Locale.ENGLISH);
    String buildId = Build.ID.toLowerCase(Locale.ENGLISH);
    //            String sdkVersion = android.os.Build.VERSION.RELEASE.toLowerCase(Locale.ENGLISH);

    if (!(manufacturer.contains("samsung")) && !(manufacturer.contains("sony"))) {
        setPreDefinedCameraUri = true;
    }
    if (manufacturer.contains("samsung") && model.contains("galaxy nexus")) { //TESTED
        setPreDefinedCameraUri = true;
    }
    if (manufacturer.contains("samsung") && model.contains("gt-n7000") && buildId.contains("imm76l")) { //TESTED
        setPreDefinedCameraUri = true;
    }

    if (buildType.contains("userdebug") && buildDevice.contains("ariesve")) { //TESTED
        setPreDefinedCameraUri = true;
    }
    if (buildType.contains("userdebug") && buildDevice.contains("crespo")) { //TESTED
        setPreDefinedCameraUri = true;
    }
    if (buildType.contains("userdebug") && buildDevice.contains("gt-i9100")) { //TESTED
        setPreDefinedCameraUri = true;
    }

    ///////////////////////////////////////////////////////////////////////////
    // TEST
    if (manufacturer.contains("samsung") && model.contains("sgh-t999l")) { //T-Mobile LTE enabled Samsung S3
        setPreDefinedCameraUri = true;
    }
    if (buildDevice.contains("cooper")) {
        setPreDefinedCameraUri = true;
    }
    if (buildType.contains("userdebug") && buildDevice.contains("t0lte")) {
        setPreDefinedCameraUri = true;
    }
    if (buildType.contains("userdebug") && buildDevice.contains("kot49h")) {
        setPreDefinedCameraUri = true;
    }
    if (buildType.contains("userdebug") && buildDevice.contains("t03g")) {
        setPreDefinedCameraUri = true;
    }
    if (buildType.contains("userdebug") && buildDevice.contains("gt-i9300")) {
        setPreDefinedCameraUri = true;
    }
    if (buildType.contains("userdebug") && buildDevice.contains("gt-i9195")) {
        setPreDefinedCameraUri = true;
    }
    if (buildType.contains("userdebug") && buildDevice.contains("xperia u")) {
        setPreDefinedCameraUri = true;
    }

    ///////////////////////////////////////////////////////////////////////////
    return setPreDefinedCameraUri;
}

From source file:org.akvo.caddisfly.helper.TestConfigHelper.java

private static JSONObject getDeviceDetails() throws JSONException {
    JSONObject details = new JSONObject();
    details.put("model", Build.MODEL);
    details.put("product", Build.PRODUCT);
    details.put("manufacturer", Build.MANUFACTURER);
    details.put("os", "Android - " + Build.VERSION.RELEASE + " (" + Build.VERSION.SDK_INT + ")");
    details.put("country", Locale.getDefault().getCountry());
    details.put("language", Locale.getDefault().getLanguage());
    return details;
}

From source file:com.ternup.caddisfly.fragment.ResultFragment.java

public void postResult(final String url) {

    RequestParams params = new RequestParams();
    TimeZone tz = TimeZone.getTimeZone("UTC");
    final DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'");
    df.setTimeZone(tz);//from ww  w. j  a va2s. com

    final ArrayList<String> filePaths = FileUtils.getFilePaths(getActivity(), folderName, "/small/",
            mLocationId);
    File myFile = new File(filePaths.get(0));
    String date = df.format(DateUtils.getDateFromFilename(myFile.getName()));

    params.put("date", date);
    String deviceId = Build.MANUFACTURER + " " + Build.MODEL;
    if (deviceId.length() > 32) {
        deviceId = deviceId.substring(1, 32);
    }
    params.put("deviceId", deviceId);
    params.put("type", String.valueOf(mTestTypeId + 1));

    if (wakeLock == null || !wakeLock.isHeld()) {
        PowerManager pm = (PowerManager) getActivity().getApplicationContext()
                .getSystemService(Context.POWER_SERVICE);
        wakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP
                | PowerManager.ON_AFTER_RELEASE, "MyWakeLock");
        wakeLock.acquire();
    }

    WebClient.post("tests", params, new AsyncHttpResponseHandler() {
        @Override
        public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
            String response = responseBody == null ? null : new String(responseBody);
            try {
                JSONObject json = new JSONObject(response);
                final int newId = json.getInt("id");
                if (filePaths.size() > 0) {
                    count = 0;
                    totalCount = filePaths.size();
                    postItem(newId, filePaths);
                }

            } catch (JSONException e) {
                e.printStackTrace();
            }
        }

        @Override
        public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
            Log.d(Globals.DEBUG_TAG, "fail: " + error.getMessage());
            getActivity().runOnUiThread(new Runnable() {
                public void run() {
                    if (progressDialog != null) {
                        progressDialog.dismiss();
                    }

                    if (wakeLock != null && wakeLock.isHeld()) {
                        wakeLock.release();
                    }
                }
            });

        }
    });
}

From source file:edu.auburn.ppl.cyclecolumbus.TripUploader.java

/******************************************************************************************
 * Retrieves the app version of the phone
 ******************************************************************************************
 * @return app version//w ww  .j a va  2s.c  o  m
 ******************************************************************************************/
public String getAppVersion() {
    String versionName = "";
    int versionCode = 0;

    try {
        PackageInfo pInfo = mCtx.getPackageManager().getPackageInfo(mCtx.getPackageName(), 0);
        versionName = pInfo.versionName;
        versionCode = pInfo.versionCode;
    } catch (PackageManager.NameNotFoundException e) {
        e.printStackTrace();
    }

    String systemVersion = Build.VERSION.RELEASE;

    String manufacturer = Build.MANUFACTURER;
    String model = Build.MODEL;
    if (model.startsWith(manufacturer)) {
        return versionName + " (" + versionCode + ") on Android " + systemVersion + " " + capitalize(model);
    } else {
        return versionName + " (" + versionCode + ") on Android " + systemVersion + " "
                + capitalize(manufacturer) + " " + model;
    }
}

From source file:com.silentcircle.silenttext.util.DeviceUtils.java

public static String getManufacturer() {
    String manufacturer = System.getProperty("ro.product.manufacturer");
    return manufacturer == null ? android.os.Build.MANUFACTURER : manufacturer;
}

From source file:ee.ioc.phon.android.speak.Utils.java

public static String makeUserAgentComment(String tag, String versionName, String caller) {
    return tag + "/" + versionName + "; " + Build.MANUFACTURER + "/" + Build.DEVICE + "/" + Build.DISPLAY + "; "
            + caller;/*from  w  w  w  .j  av  a  2 s.  c  om*/
}

From source file:de.da_sense.moses.client.abstraction.HardwareAbstraction.java

/**
 * This method reads the sensors currently chosen by the user
 * @return the actual Hardwareinfo/*from  ww w  . j  a  v  a2 s.  c  o m*/
 */
private HardwareInfo retrieveHardwareParameters() {
    // *** SENDING SET_HARDWARE_PARAMETERS REQUEST TO SERVER ***//
    LinkedList<Integer> sensors = new LinkedList<Integer>();
    SensorManager s = (SensorManager) mContext.getSystemService(Context.SENSOR_SERVICE);
    for (Sensor sen : s.getSensorList(Sensor.TYPE_ALL)) {
        sensors.add(sen.getType());
    }
    return new HardwareInfo(extractDeviceIdFromSharedPreferences(), extractDeviceNameFromSharedPreferences(),
            Build.MANUFACTURER, Build.MODEL, Build.VERSION.SDK_INT, sensors);
}