如何实现“Printer Discover”这样的服务发现在安卓上?
我想了解 android 支持的“服务发现”机制 - 特别是打印机发现。
android 是否提供了这样的发现选项?例子:支持snmp广播吗?
我尝试了应用程序“PrinterShare”链接:http://www.printeranywhere.com/mobile.sdf 其中 Printer Discovery 是通过 ipp 实现的。
任何帮助表示赞赏。
I would like to know about the 'service discovery' mechanisms supported by android - particularly, Printer Discovery.
Does android provide such a discovery option? example : support for snmp broadcast?
I tried out an application "PrinterShare" link : http://www.printeranywhere.com/mobile.sdf where Printer Discovery is achieved through ipp.
Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
罗伊,我遇到了和你一样的问题,甚至在实际设备上运行该代码片段时也得到了相同的行为(独立运行代码时,而不是在 Android 中,工作得很好)。我找到了此页面并使其正常工作,尽管仅在设备上,通过使用以下是找出广播IP(而不是239.255.255.250):
希望有帮助:)
Roy, I came across the same problem as you, and was even getting the same behavior when running that code snippet on an actual device (while running the code standalone, not in android, worked fine). I found this page and got it working, although only on the device, by using the following to figure out the Broadcast IP (instead of 239.255.255.250):
Hope that helps:)
据我所知,抱歉。
Not that I am aware of, sorry.
此代码片段在 J2SE 上运行良好。但是,在 Android 模拟器上,我收到“超时异常”,响应 = 'null'
`DatagramSocket clientSocket = new DatagramSocket(8888);
clientSocket.setSoTimeout(20000);
This code snippet works fine on J2SE. However, on the Android emulator, I get a 'Time Out Exception' with response = 'null'
`DatagramSocket clientSocket = new DatagramSocket(8888);
clientSocket.setSoTimeout(20000);
对于在 .NET 中评估 SSDP,此库可能很有用
https://yortw.github.io/RSSDP/< /a>
For evaluation of SSDP in .NET this library may be useful
https://yortw.github.io/RSSDP/