List of usage examples for android.os Build MODEL
String MODEL
To view the source code for android.os Build MODEL.
Click Source Link
From source file:com.att.android.arodatacollector.main.AROCollectorService.java
/** * get the device name (manufacturer + model) * @return device manufacturer and model in lower case *///from w w w. ja va 2 s . co m private String getDeviceName() { String manufacturer = Build.MANUFACTURER.toLowerCase(); String model = Build.MODEL.toLowerCase(); if (model.startsWith(manufacturer)) { return model; } else { return manufacturer + " " + model; } }
From source file:com.sxnyodot.uefqvmio207964.Util.java
static String m984s() { return Build.MODEL; }
From source file:com.qa.perf.emmageeplus.service.EmmageeService.java
/** * write the test result to csv format report. *//*from ww w.j av a 2s .c om*/ private void createResultCsv() { Calendar cal = Calendar.getInstance(); SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss"); String mDateTime; String heapData = ""; if ((Build.MODEL.equals("sdk")) || (Build.MODEL.equals("google_sdk"))) mDateTime = formatter.format(cal.getTime().getTime() + 8 * 60 * 60 * 1000); else mDateTime = formatter.format(cal.getTime().getTime()); if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED)) { // 4.0/sdcard/mnt/sdcard4.0/storage/sdcard0sdcard/sdcard resultFilePath = "/sdcard" + File.separator + "Emmagee_TestResult_" + mDateTime + ".csv"; // resultFilePath = // android.os.Environment.getExternalStorageDirectory() + // File.separator + "Emmagee_TestResult_" + mDateTime + ".csv"; } else { resultFilePath = getBaseContext().getFilesDir().getPath() + File.separator + "Emmagee_TestResult_" + mDateTime + ".csv"; } try { File resultFile = new File(resultFilePath); resultFile.createNewFile(); out = new FileOutputStream(resultFile); osw = new OutputStreamWriter(out); bw = new BufferedWriter(osw); long totalMemorySize = memoryInfo.getTotalMemory(); String totalMemory = fomart.format((double) totalMemorySize / 1024); String multiCpuTitle = BLANK_STRING; // titles of multiple cpu cores ArrayList<String> cpuList = cpuInfo.getCpuList(); for (int i = 0; i < cpuList.size(); i++) { multiCpuTitle += Constants.COMMA + cpuList.get(i) + getString(R.string.total_usage); } bw.write(getString(R.string.process_package) + Constants.COMMA + packageName + Constants.LINE_END + getString(R.string.process_name) + Constants.COMMA + appName + Constants.LINE_END + getString(R.string.process_pid) + Constants.COMMA + pid + Constants.LINE_END + getString(R.string.mem_size) + Constants.COMMA + totalMemory + "MB" + Constants.LINE_END + getString(R.string.cpu_type) + Constants.COMMA + cpuInfo.getCpuName() + Constants.LINE_END + getString(R.string.android_system_version) + Constants.COMMA + memoryInfo.getSDKVersion() + Constants.LINE_END + getString(R.string.mobile_type) + Constants.COMMA + memoryInfo.getPhoneType() + Constants.LINE_END + "UID" + Constants.COMMA + uid + Constants.LINE_END); if (isGrantedReadLogsPermission()) { bw.write(START_TIME); } if (isRoot) { heapData = getString(R.string.native_heap) + Constants.COMMA + getString(R.string.dalvik_heap) + Constants.COMMA; } bw.write(getString(R.string.timestamp) + Constants.COMMA + getString(R.string.top_activity) + Constants.COMMA + heapData + getString(R.string.used_mem_PSS) + Constants.COMMA + getString(R.string.used_mem_ratio) + Constants.COMMA + getString(R.string.mobile_free_mem) + Constants.COMMA + getString(R.string.app_used_cpu_ratio) + Constants.COMMA + getString(R.string.total_used_cpu_ratio) + multiCpuTitle + Constants.COMMA + getString(R.string.traffic) + Constants.COMMA + getString(R.string.battery) + Constants.COMMA + getString(R.string.current) + Constants.COMMA + getString(R.string.temperature) + Constants.COMMA + getString(R.string.voltage) + Constants.COMMA + getString(R.string.fps) + Constants.LINE_END); } catch (IOException e) { Log.e(LOG_TAG, e.getMessage()); } }
From source file:com.mi.xserv.Xserv.java
private void handshake() { JSONObject stat = new JSONObject(); try {/*w w w . ja va 2s. c o m*/ String model = Build.MODEL; if (model.length() > 45) { model = model.substring(0, 45); } stat.put("uuid", getDeviceID()); stat.put("device_token", getDeviceToken()); stat.put("model", model); stat.put("os", "Android " + Build.VERSION.RELEASE); stat.put("tz_offset", getTimeZoneOffset()); stat.put("tz_dst", getTimeZoneDst()); stat.put("lang", getLanguage()); } catch (JSONException e) { e.printStackTrace(); } wsSend(stat); }
From source file:org.hw.parlance.SetupActivity.java
private void sendEcCalibrationResult(EcCalibratorStatus status, int delayMs) { try {/*w w w . j av a 2s.c om*/ XMLRPCClient client = new XMLRPCClient(new URL(getString(R.string.wizard_url))); XMLRPCCallback listener = new XMLRPCCallback() { Runnable runFinished = new Runnable() { public void run() { SetupActivity.instance().isEchoCalibrationFinished(); } }; public void onResponse(long id, Object result) { mHandler.post(runFinished); } public void onError(long id, XMLRPCException error) { mHandler.post(runFinished); } public void onServerError(long id, XMLRPCServerException error) { mHandler.post(runFinished); } }; Log.i("Add echo canceller calibration result: manufacturer=" + Build.MANUFACTURER + " model=" + Build.MODEL + " status=" + status + " delay=" + delayMs + "ms"); client.callAsync(listener, "add_ec_calibration_result", Build.MANUFACTURER, Build.MODEL, status.toString(), delayMs); } catch (Exception ex) { } }
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();//www .j a v a 2 s. com 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"); }//ww w .j a v a2s . com return sb.append(getString(R.string.extra_text_end)).toString(); }
From source file:com.juanojfp.gcmsample.MainActivity.java
public String registerInServer(String token) { String imei = Build.SERIAL;/*from w w w . j av a2 s.c o m*/ String model = Build.MANUFACTURER + ":" + Build.MODEL; String sdk = Build.VERSION.SDK + ":" + Build.VERSION.RELEASE; Log.e("RegisterInServer", "Imei: " + imei); HttpClient client = new DefaultHttpClient(); StringBuilder peticion = new StringBuilder(); peticion.append(URL_TO_SERVER).append(MODULE_DEVICE).append(COMMAND_REGISTER); Log.e("Peticion:", peticion.toString()); HttpPost method = new HttpPost(peticion.toString()); String msgServer; try { List<NameValuePair> nvp = new ArrayList<NameValuePair>(); nvp.add(new BasicNameValuePair(PARAM_C2DM_DEVICE_TOKEN, token)); nvp.add(new BasicNameValuePair(PARAM_C2DM_DEVICE_IMEI, imei)); nvp.add(new BasicNameValuePair(PARAM_C2DM_DEVICE_MODEL, model)); nvp.add(new BasicNameValuePair(PARAM_C2DM_DEVICE_SDK, sdk)); for (NameValuePair v : nvp) Log.e("Parametro", v.getName() + ":" + v.getValue()); method.setEntity(new UrlEncodedFormEntity(nvp, HTTP.UTF_8)); HttpResponse response = client.execute(method); //Respuestas //{'message':'username', 'id':idUser, 'code':0} //{'message':'Token perdido', 'code':1} JSONObject json = new JSONObject(input2String(response.getEntity().getContent())); String msg = json.getString(PARAM_C2DM_DEVICE_MESSAGE); int id = json.getInt(PARAM_C2DM_DEVICE_MESSAGE_ID); int code = json.getInt(PARAM_C2DM_DEVICE_MESSAGE_CODE); msgServer = id + ":" + msg + ":" + code; } catch (ClientProtocolException e) { // TODO Auto-generated catch block msgServer = e.getMessage(); e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block msgServer = e.getMessage(); e.printStackTrace(); } catch (IllegalStateException e) { // TODO Auto-generated catch block msgServer = e.getMessage(); e.printStackTrace(); } catch (JSONException e) { // TODO Auto-generated catch block msgServer = e.getMessage(); e.printStackTrace(); } Log.e("Serever Response", msgServer); return msgServer; }
From source file:org.disrupted.rumble.database.statistics.StatisticManager.java
public JSONObject generateStatJSON() throws JSONException { JSONObject json = new JSONObject(); json.put("rumble_version", RumbleApplication.BUILD_VERSION); json.put("android_build", Integer.toString(Build.VERSION.SDK_INT)); json.put("phone_model", Build.MODEL); json.put("anonymous_id", RumblePreferences.getAnonymousID(RumbleApplication.getContext())); json.put("timestamp", System.currentTimeMillis()); JSONArray resultSet;/* ww w.ja v a2 s . co m*/ resultSet = DatabaseFactory.getStatChannelDatabase(RumbleApplication.getContext()).getJSON(); json.put("channels", resultSet); resultSet = DatabaseFactory.getStatLinkLayerDatabase(RumbleApplication.getContext()).getJSON(); json.put("link-layer", resultSet); resultSet = DatabaseFactory.getStatReachabilityDatabase(RumbleApplication.getContext()).getJSON(); json.put("reachability", resultSet); resultSet = DatabaseFactory.getStatMessageDatabase(RumbleApplication.getContext()).getJSON(); json.put("messages", resultSet); resultSet = new JSONArray(); resultSet.put((new JSONObject()).put( DatabaseFactory.getPushStatusDatabase(RumbleApplication.getContext()).getTableName(), DatabaseFactory.getPushStatusDatabase(RumbleApplication.getContext()).getCount())); resultSet.put((new JSONObject()).put( DatabaseFactory.getChatMessageDatabase(RumbleApplication.getContext()).getTableName(), DatabaseFactory.getChatMessageDatabase(RumbleApplication.getContext()).getCount())); resultSet.put((new JSONObject()).put( DatabaseFactory.getGroupDatabase(RumbleApplication.getContext()).getTableName(), DatabaseFactory.getGroupDatabase(RumbleApplication.getContext()).getCount())); resultSet.put((new JSONObject()).put( DatabaseFactory.getContactDatabase(RumbleApplication.getContext()).getTableName(), DatabaseFactory.getContactDatabase(RumbleApplication.getContext()).getCount())); resultSet.put((new JSONObject()).put( DatabaseFactory.getHashtagDatabase(RumbleApplication.getContext()).getTableName(), DatabaseFactory.getHashtagDatabase(RumbleApplication.getContext()).getCount())); long fileSize = 0; long freespace = 0; try { File dir = FileUtil.getReadableAlbumStorageDir(); if (dir != null) { File files[] = dir.listFiles(); if (files != null) { for (File file : files) { fileSize += file.length(); } } freespace = dir.getFreeSpace(); } } catch (IOException ie) { } resultSet.put((new JSONObject()).put(KEY_FREE_SPACE, freespace)); resultSet.put((new JSONObject()).put(KEY_FILE_SIZE, fileSize)); json.put("db", resultSet); return json; }
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 2 s .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(); }