public class NetHotspot extends Object
Using these interfaces, you can enable or disable a hotspot and query hotspot information.
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
String[] |
getHotspotIfaces() |
Obtains the names of the NICs that are serving as hotspots.
|
static NetHotspot |
getInstance(Context context) |
Creates a
NetHotspot object. |
String[] |
getNetHotspotAbleIfaces() |
Obtains the names of the NICs that can serve as hotspots.
|
static long |
getRxBytes() |
Obtains the number of downlink data bytes of the NIC that serves as a hotspot.
|
static long |
getTxBytes() |
Obtains the number of uplink data bytes of the NIC that serves as a hotspot.
|
public static NetHotspot getInstance(Context context)
NetHotspot object.context - Indicates the application context. For details, see Context.NetHotspot object.public String[] getNetHotspotAbleIfaces()
To call this method, your application must have the
ohos.permission.GET_NETWORK_INFO permission.
null if no such NIC is found.public String[] getHotspotIfaces()
To call this method, your application must have the
ohos.permission.GET_NETWORK_INFO permission.
null if no such NIC is found.public static long getTxBytes()
To call this method, your application must have the
ohos.permission.CONNECTIVITY_INTERNAL permission.
public static long getRxBytes()
To call this method, your application must have the
ohos.permission.CONNECTIVITY_INTERNAL permission.