MCPcopy Create free account
hub / github.com/FongMi/TV / getWifiAddress

Method getWifiAddress

catvod/src/main/java/com/github/catvod/utils/Util.java:126–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124 }
125
126 private static String getWifiAddress() {
127 WifiManager manager = (WifiManager) Init.context().getApplicationContext().getSystemService(Context.WIFI_SERVICE);
128 int ip = manager.getConnectionInfo().getIpAddress();
129 return ip == 0 ? "" : String.format(Locale.getDefault(), "%d.%d.%d.%d", ip & 0xFF, (ip >> 8) & 0xFF, (ip >> 16) & 0xFF, (ip >> 24) & 0xFF);
130 }
131
132 private static String getHostAddress(String keyword) throws SocketException {
133 for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements(); ) {

Callers 1

getIpMethod · 0.95

Calls 2

contextMethod · 0.95
formatMethod · 0.45

Tested by

no test coverage detected