public final class AndroidNetwork
extends java.lang.Object
| Constructor and Description |
|---|
AndroidNetwork() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getHostIP()
获取ip地址
使用DNS解析某地址时,可能会同时返回IPv4和IPv6的地址。
如果同时拥有IPv4和IPv6的地址,是会默认优先上报IPv6的地址
|
static int |
getMobileDbm()
强制检查权限 android.permission.ACCESS_COARSE_LOCATION,上层未给权限时返回-1表示获取失败
API >= 18
|
static boolean |
isNetWorkReady() |
static java.lang.String |
networkType(android.content.Context context) |
public static boolean isNetWorkReady()
public static java.lang.String getHostIP()
public static java.lang.String networkType(android.content.Context context)
public static int getMobileDbm()