Android: Get Hardware Information Programmatically

Log.i(“TAG”, “SERIAL: ” + Build.SERIAL); Log.i(“TAG”,”MODEL: ” + Build.MODEL); Log.i(“TAG”,”ID: ” + Build.ID); Log.i(“TAG”,”Manufacture: ” + Build.MANUFACTURER); Log.i(“TAG”,”brand: ” + Build.BRAND); Log.i(“TAG”,”type: ” + Build.TYPE); Log.i(“TAG”,”user: ” + Build.USER); Log.i(“TAG”,”BASE: ” + Build.VERSION_CODES.BASE); Log.i(“TAG”,”INCREMENTAL ” + Build.VERSION.INCREMENTAL); Log.i(“TAG”,”SDK ” + Build.VERSION.SDK); Log.i(“TAG”,”BOARD: ” + Build.BOARD); Log.i(“TAG”,”BRAND ” + Build.BRAND); Log.i(“TAG”,”HOST ” + Build.HOST); Log.i(“TAG”,”FINGERPRINT: “+Build.FINGERPRINT); … Read more

Android camera android.hardware.Camera deprecated

API Documentation According to the Android developers guide for android.hardware.Camera, they state: We recommend using the new android.hardware.camera2 API for new applications. On the information page about android.hardware.camera2, (linked above), it is stated: The android.hardware.camera2 package provides an interface to individual camera devices connected to an Android device. It replaces the deprecated Camera class. The … Read more

Android AudioRecord class – process live mic audio quickly, set up callback function

After experimenting lots with the notifications and a bunch of other techniques I settled on this code: private class AudioIn extends Thread { private boolean stopped = false; private AudioIn() { start(); } @Override public void run() { android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO); AudioRecord recorder = null; short[][] buffers = new short[256][160]; int ix = 0; try { // … Read more

Get Android Phone Model programmatically , How to get Device name and model programmatically in android?

I use the following code to get the full device name. It gets model and manufacturer strings and concatenates them unless model string already contains manufacturer name (on some phones it does): public String getDeviceName() { String manufacturer = Build.MANUFACTURER; String model = Build.MODEL; if (model.toLowerCase().startsWith(manufacturer.toLowerCase())) { return capitalize(model); } else { return capitalize(manufacturer) + … Read more