文章      动态     相关文章     最新文章     手机版动态     相关动态     |   首页|会员中心|保存桌面|手机浏览

ns3jwp

http://keair.bhha.com.cn/comns3jwp/

相关列表
文章列表
  • 暂无文章
推荐文章
联系方式
  • 联系人:李女士
  • 电话:15639270630
android获取手机各种信息代码各种手机「android获取手机各种信息代码」
发布时间:2025-02-22        浏览次数:1        返回列表

public class AndroidPhone
{
private AndroidPhone()
{
}



public void getInfo(Context context)
{
TelephonyManager mTm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String imei = mTm.getDeviceId();
String imsi = mTm.getSubscriberId();
String mtype = android.os.Build.MODEL; // 手机型号
String mtyb = android.os.Build.BRAND;// 手机品牌
String numer = mTm.getLine1Number(); // 手机号码,有的可得,有的不可得
Log.i("text", "手机IMEI号" + imei + "手机IESI号" + imsi + "手机型号" + mtype + "手机品牌" + mtyb + "手机号码" + numer);
}



public static String getDeviceId(Context context)
{
TelephonyManager mTm = getTelephonyManager(context);
String imei = mTm.getDeviceId();
return imei;
}



public static String getPhoneModel()
{
String mtype = android.os.Build.MODEL; // 手机型号
return mtype;
}



private static TelephonyManager getTelephonyManager(Context context)
{
TelephonyManager mTm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
return mTm;
}



public String getMacAddress(Context context)
{
String result = "";
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
result = wifiInfo.getMacAddress();
Log.i("text", "手机macAdd:" + result);
return result;
}



public String[] getCpuInfo()
{
String str1 = "/proc/cpuinfo";
String str2 = "";
String[] cpuInfo = { "", "" }; // 1-cpu型号 //2-cpu频率
String[] arrayOfString;
try
{
FileReader fr = new FileReader(str1);
BufferedReader localBufferedReader = new BufferedReader(fr, 8192);
str2 = localBufferedReader.readLine();
arrayOfString = str2.split("\s+");
for (int i = 2; i < arrayOfString.length; i++)
{
cpuInfo[0] = cpuInfo[0] + arrayOfString[i] + " ";
}
str2 = localBufferedReader.readLine();
arrayOfString = str2.split("\s+");
cpuInfo[1] += arrayOfString[2];
localBufferedReader.close();
}
catch (IOException e)
{
}
Log.i("text", "cpuinfo:" + cpuInfo[0] + " " + cpuInfo[1]);
return cpuInfo;
}