/
For Couch
44 lines (39 loc) · 1.67 KB
/
For Couch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
1. 设备:
Build.MODEL
or better solution: see here
https://stackoverflow.com/questions/1995439/get-android-phone-model-programmatically
2. 设备串号:
Build.SERIAL
E.g.
Log.i("TAG","android.os.Build.SERIAL: " + Build.SERIAL);
3. 网路类型
http://blog.csdn.net/oqihaogongyuan/article/details/50911415
4. 分辨率
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;
int height = size.y;
5. 运营商
/**
* 返回运营商 需要加入权限 <uses-permission android:name="android.permission.READ_PHONE_STATE"/> <BR>
*
* @return 1,代表中国移动,2,代表中国联通,3,代表中国电信,0,代表未知
* @author youzc@yiche.com
*/
public int getOperators(Context context) {
// 移动设备网络代码(英语:Mobile Network Code,MNC)是与移动设备国家代码(Mobile Country Code,MCC)(也称为“MCC /
// MNC”)相结合, 例如46000,前三位是MCC,后两位是MNC 获取手机服务商信息
int OperatorsName = 0;
String IMSI = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE).getSubscriberId();
// IMSI号前面3位460是国家,紧接着后面2位00 运营商代码
System.out.println(IMSI);
if (IMSI.startsWith("46000") || IMSI.startsWith("46002") || IMSI.startsWith("46007")) {
OperatorsName = 1;
} else if (IMSI.startsWith("46001") || IMSI.startsWith("46006")) {
OperatorsName = 2;
} else if (IMSI.startsWith("46003") || IMSI.startsWith("46005")) {
OperatorsName = 3;
}
return OperatorsName;
}