Android 网络工具

标签 android dhcp

我想在这篇文章中提到的 NetworkUtils 中使用 rundhcp() 函数。

How do you get the current DNS servers for Android?

我需要它来获取用于移动连接的 Dhcp 对象。但是 NetworkUtils 类似乎不是 sdk 的一部分。开发人员文档中也未提及它。

如何在我的应用程序中包含和使用 NetworkUtils 类。

最佳答案

也许这就足够了?

    WifiManager wifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
    WifiInfo wifiInfo = wifiManager.getConnectionInfo();
    DhcpInfo dhcp = wifiManager.getDhcpInfo();

关于Android 网络工具,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8722047/

相关文章:

android - 我可以在中国使用 Google Maps API吗

android - 如何将图片存入数据库

linux - DHCP 的实际完整形式是什么? C代表什么控制或配置

configuration-files - isc-dhcp-server 未启动错误 : not configured to listen to any interfaces

linux - dhcpv6 返回错误子网

linux - DHCP 服务器是否可以给出比 DHCP 客户端请求的租用时间更长的租用时间?

java - Android ccavenue支付网关集成

android - 如何使用 monkeyrunner 轻弹?不只是拖动

php - 安卓和php

linux - 如何删除特定的 dhcp 响应?