如何获得当前系统DNS解析器IP地址的代号为1? [英] How to get current system DNS resolvers ip-addresses in codename one?

查看:74
本文介绍了如何获得当前系统DNS解析器IP地址的代号为1?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以获取代号为1的所有当前系统DNS解析器ip地址?

Is there a way to get all current system DNS resolver ip-addresses in codename one?

NetworkManager ConnectionRequest 不提供这些信息。

一般来说,代号似乎不提供任何方式来访问设备的通信状态信息,例如 Wi-Fi Mac地址, IMEI,移动网络类型等。对吗?

In general Codename One seems not to provide any way to access a devices communication status information like "Wi-Fi Mac address", "IMEI", "Mobile network type" etc. Am I right?

推荐答案

您是说类似 Socket.getHostOrIP()吗?

没有标准化的显式DNS

There is no standardized explicit DNS lookup API though.

大多数这些东西在整个平台上都不可用,甚至在平台内也不是始终可用的。您可以将Display的 getProperty IMEI UDID & MSISDN 。但这将只有在Android上运行的机会,您可能需要添加构建提示

Most of these things aren't available across platform or even consistently within the platform. You can use Display's getProperty with "IMEI", "UDID" & "MSISDN". But that will only have any chance of working on Android and you will probably need to add the build hint for permissions.

您还可以始终按照开发人员指南我该怎么办?视频。

You can also always use native code calls as explained in the developer guide and the How Do I? video.

我建议您重新考虑获得这些价值并评估解决之道。例如,大多数广告客户不再需要它们,因为并非所有移动操作系统都提供它们。

I would suggest that you revisit your need to get these values and evaluate a way around them. E.g most advertisers no longer require them as they aren't provided by all mobile OS's.

这篇关于如何获得当前系统DNS解析器IP地址的代号为1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆