Open file with MIDlet.platformRequest()

寵の児 提交于 2019-12-07 17:36:51

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/286855/open-file-with-midlet-platformrequest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!