Android:获取移动硬件信息

Android:获取移动硬件信息,android,mobile,hardware,Android,Mobile,Hardware,我想以编程方式获取移动设备的RAM,ROM,CPU,电池,内部存储器。我已经获得了设备的内部ID、设备名称和指纹。我问了很多问题,但没有找到解决办法。任何有关这方面的帮助都将不胜感激 我想得到这些信息像这样的看法 此代码段将提供您所需的大部分信息 //Ram information ActivityManager actManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE); MemoryInfo memInfo = ne

我想以编程方式获取移动设备的
RAM
ROM
CPU
电池
内部存储器
。我已经获得了设备的内部ID、设备名称和指纹。我问了很多问题,但没有找到解决办法。任何有关这方面的帮助都将不胜感激

我想得到这些信息像这样的看法

此代码段将提供您所需的大部分信息

//Ram information  
ActivityManager actManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
MemoryInfo memInfo = new ActivityManager.MemoryInfo();
actManager.getMemoryInfo(memInfo);
long totalMemory = memInfo.totalMem;

//Internal Space
long freeBytesInternal = new File(ctx.getFilesDir().getAbsoluteFile().toString()).getFreeSpace();

//External Available space
long freeBytesExternal = new File(getExternalFilesDir(null).toString()).getFreeSpace();

//This will out put whole lot of information about cpu just extract what you want
String[] args = {"/system/bin/cat", "/proc/cpuinfo"};
ProcessBuilder pb = new ProcessBuilder(args);

Process process = pb.start();
InputStream in = process.getInputStream();

//Battery information
BatteryManager bm = (BatteryManager)getSystemService(BATTERY_SERVICE);
int batLevel = bm.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY);

我在我的代码中使用了这个,所以我把所有:

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);
Log.i("TAG","Version Code: " + Build.VERSION.RELEASE);

检查设备控制。它是开源的,包括这些信息。