开发者

Blackberry Widget: Where is the www folder on the device?

开发者 https://www.devze.com 2023-02-16 18:55 出处:网络
Where do the files I put in the \"www\" directory before building a Blackberry widget end up on the device?

Where do the files I put in the "www" directory before building a Blackberry widget end up on the device?

Background: I would like to read the content of some of the files (e.g. "www/index.html") from t开发者_开发技巧he www directory in the native Java part of the widget. (I already used FileConnection.list to write the name of all files on the device to System.out - neither index.html nor any other file from the www directory was part of the list.)

The widget is based on PhoneGap 0.9.4 for Blackberry but that shouldn't make a difference.


Found the answer: The files are packaged as resources. Therefore it's possible to read them with Class.getResourceAsStream.

Example: getClass().getResourceAsStream("/index.html");

0

精彩评论

暂无评论...
验证码 换一张
取 消