使用 MIDlet.platformRequest() 打开文件
是否可以使用 MIDlet.platformRequest(String url)
方法让设备打开磁盘上的文件? 我希望使用以下内容:
midlet.platformRequest("file:///path/to/file/file.png");
但这只会引发 ConnectionNotFound
d 异常。 我专门使用 BlackBerry 平台,但我无法访问专有的 BlackBerry API。 文件可以是任何类型,所以显然我不希望它能够处理所有类型。
干杯
Is it possible to get a device to open a file on disk using the MIDlet.platformRequest(String url)
method? I was hoping to use the following:
midlet.platformRequest("file:///path/to/file/file.png");
But this just throws a ConnectionNotFoun
d exception. I'm specifically using the BlackBerry platform, but I do not have access to the proprietary BlackBerry API. File could be of any type, so obviously I'm not expecting it to handle every one.
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,不可能使用平台请求打开任意文件。 MIDP 2.0 要求设备仅支持 URL 和 tel: 连接的平台请求。 所有其他方案都是可选的并且依赖于设备。
诺基亚 S60 手机似乎支持 file://,如 诺基亚论坛。 但您需要验证其他平台,包括黑莓。
您可以查看 JSR211 Content Handler API 作为替代方案。 我相信较新的黑莓设备支持它。
No, it is not possible to open arbitrary files using platform request. MIDP 2.0 requires devices to support platform request only for URL and tel: connections. All other schemes are optional and device dependent.
Nokia S60 phones seems to support file:// as pointed out in forum Nokia. But you need to verify for other platforms including Blackberry.
You can look at JSR211 Content Handler API as an alternative. I believe it is supported in newer Blackberry devices.