使用 MIDlet.platformRequest() 打开文件

发布于 2024-07-08 12:09:22 字数 333 浏览 10 评论 0原文

是否可以使用 MIDlet.platformRequest(String url) 方法让设备打开磁盘上的文件? 我希望使用以下内容:

midlet.platformRequest("file:///path/to/file/file.png");

但这只会引发 ConnectionNotFoundd 异常。 我专门使用 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 ConnectionNotFound 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

固执像三岁 2024-07-15 12:09:22

不,不可能使用平台请求打开任意文件。 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文