public final class DeviceInfo extends Object
限定符和类型 | 字段和说明 |
---|---|
static String |
ANDROID |
static int |
NETWORK_CLASS_2G |
static int |
NETWORK_CLASS_3G |
static int |
NETWORK_CLASS_4G |
static int |
NETWORK_CLASS_UNAVAILABLE |
static int |
NETWORK_CLASS_UNKNOWN |
static int |
NETWORK_CLASS_WIFI |
static int |
NETWORK_TYPE_UNAVAILABLE |
static int |
NETWORK_TYPE_WIFI |
static String |
UNKNOWN |
限定符和类型 | 方法和说明 |
---|---|
static boolean |
checkDeviceHasNavigationBar(Context context)
检测是否具有底部导航栏
|
static Object |
getAppMetaData(Context context,
String key)
获取Meta数据
|
static String |
getAppStringMetaData(Context context,
String key)
获取StringMeta数据
|
static String |
getAppVersion(Context context)
获取app版本号
|
static int |
getAppVersionCode(Context context)
获取app版本号
|
static String |
getCharset()
获取系统文件编码类型
|
static String |
getCountry()
获取设备国家
|
static String |
getCPUABI()
获取CPU架构
|
static String |
getCPUInfo()
获取设备cpu信息
|
static String |
getCurProcessName(Context context)
获取当前进程name
|
static float |
getDensity(Context context)
获取设备Density
|
static float |
getDensityDpi(Context context)
获取设备Density
|
static String |
getDensityDpiStr(Context context)
获取设备Densitydpi 类型
|
static String |
getDeviceBrand()
获取设备品牌
|
static String |
getDeviceId(Context context) |
static String |
getDeviceModel()
获取设备型号
|
static DisplayMetrics |
getDisplayMetrics(Context context) |
static int |
getIpAddress(Context context)
获取IP地址
|
static String |
getIpStr(Context context)
获取IP地址(%d.
|
static String |
getLanguage()
获取设备语言
|
static String |
getLocale()
获取设备Locale信息
|
static String |
getMacAddress(Context context)
获取mac地址
|
static String |
getMD5Fingerprint(Context context)
返回签名证书MD5值
|
static long |
getMemFreeSize()
获取设备mem 未使用大小 单位B
|
static String |
getMemInfo()
获取设备mem信息
|
static long |
getMemTotalSize()
获取设备mem 总大小 单位B
|
static String |
getMobileInfo()
获取设备信息
|
static int |
getNavigationBarHeight(Context context)
获取导航栏高度
|
static int |
getNetworkClass(Context context) |
static String |
getNetworkClassName(Context context) |
static String |
getNetworkOperator(Context context) |
static String |
getNetworkOperatorName(Context context)
获取设备运营商
|
static int |
getNetworkType(Context context) |
static String |
getOpenUDID(Context context)
获取设备openUDID
|
static String |
getOS()
获取操作系统类型
|
static String |
getOSVersion()
获取操作系统版本号
|
static String |
getResolution(Context context)
获取设备分辨率
|
static String |
getScreenSize(Context context)
获取屏幕物理尺寸 单位英寸
|
static String |
getSerialNumber() |
static String |
getSHA1Fingerprint(Context context)
返回签名证书SHA1值
|
static int |
getStatusBarHeight(Context context)
获取状态栏高度
|
static int |
getWifiRssi(Context context) |
static String |
getWifiRssiString(Context context) |
static boolean |
isAppProcess(Context context)
是否是app当前进程
|
static boolean |
isConnection(Context context)
判读网络是否连接
|
static boolean |
isForegroundActivity(String activityName,
Context context)
return activity is foreground
|
static boolean |
isForegroundApplication(String packageName,
Context context)
return applcation is foreground
|
static boolean |
isGPSLocation(Context context)
判断GPS定位是否开启
|
static boolean |
isNetworkLocation(Context context)
判断网络定位是否开启
|
static boolean |
isProxy(Context context)
判断设备 是否使用代理上网
|
static boolean |
isWifiConnection(Context context)
判读WIFI网络是否连接
|
static void |
syncOpenUDID(Context context) |
public static final int NETWORK_TYPE_UNAVAILABLE
public static final int NETWORK_TYPE_WIFI
public static final int NETWORK_CLASS_WIFI
public static final int NETWORK_CLASS_UNAVAILABLE
public static final int NETWORK_CLASS_2G
public static final int NETWORK_CLASS_3G
public static final int NETWORK_CLASS_4G
public static final int NETWORK_CLASS_UNKNOWN
public static String getOS()
public static String getOSVersion()
public static String getDeviceModel()
public static String getDeviceBrand()
public static String getMobileInfo()
public static long getMemTotalSize()
public static long getMemFreeSize()
public static String getMemInfo()
public static String getCPUInfo()
public static String getCPUABI()
public static String getResolution(Context context)
context
- public static int getStatusBarHeight(Context context)
context
- public static int getNavigationBarHeight(Context context)
context
- public static DisplayMetrics getDisplayMetrics(Context context)
public static float getDensity(Context context)
context
- public static float getDensityDpi(Context context)
context
- public static String getDensityDpiStr(Context context)
context
- public static String getScreenSize(Context context)
context
- public static String getNetworkOperatorName(Context context)
context
- public static String getNetworkOperator(Context context)
public static int getNetworkType(Context context)
public static int getNetworkClass(Context context)
public static String getNetworkClassName(Context context)
public static int getWifiRssi(Context context)
public static String getWifiRssiString(Context context)
public static String getLocale()
public static String getLanguage()
public static String getCountry()
public static String getAppVersion(Context context)
context
- public static int getAppVersionCode(Context context)
context
- public static Object getAppMetaData(Context context, String key)
context
- key
- public static String getAppStringMetaData(Context context, String key)
context
- key
- public static String getMacAddress(Context context)
context
- public static int getIpAddress(Context context)
context
- public static String getIpStr(Context context)
context
- public static String getCharset()
public static String getOpenUDID(Context context)
context
- public static void syncOpenUDID(Context context)
public static String getSerialNumber()
public static String getDeviceId(Context context)
public static boolean isWifiConnection(Context context)
context
- public static boolean isConnection(Context context)
context
- public static boolean isGPSLocation(Context context)
context
- public static boolean isNetworkLocation(Context context)
context
- public static String getMD5Fingerprint(Context context)
context
- public static String getSHA1Fingerprint(Context context)
context
- public static boolean isForegroundActivity(String activityName, Context context)
activityName
- context
- public static boolean isForegroundApplication(String packageName, Context context)
packageName
- context
- public static String getCurProcessName(Context context)
context
- public static boolean isProxy(Context context)
context
- public static boolean isAppProcess(Context context)
context
- public static boolean checkDeviceHasNavigationBar(Context context)