使用 Phonegap 和 Javascript 在运行时读取应用程序包中的文件
我尝试过使用 FileReader 类,但它似乎只允许访问应用程序包之外的文件 - 即文档文件夹。但我想读取应用程序包中的文件 - 例如从 Phonegap.plist 获取全局设置,确定 www 文件夹中是否存在某些文件等等。
我尝试了一些方法,但似乎不起作用。我可以在 PhoneGap 本机代码中看到它正在从 PhoneGap.plist 读取,但这似乎在 Javascript API 中不可用。
如果有人能建议我做错了什么,或者也许这是不可能的,我需要对 PhoneGap 进行更新,并将其添加到我的应用程序中,那将非常有帮助。我对 Objective-C 编程一无所知,这是主要问题!
任何想法将不胜感激。
谢谢 缺口
I've tried using the FileReader class but it only seems to allow access to files outside the app bundle -i.e. the documents folder. But I want to read files within the app bundle - for example obtaining global settings from Phonegap.plist, working out if certain files exist in the www folder and so on.
I have tried a few things but it doesn't seem to work. I can see in the PhoneGap native code it is reading from PhoneGap.plist but this doesn't seem to be available in the Javascript API.
It would be really helpful if somebody could suggest what I am doing wrong, or perhaps it's not possible and I need an update to PhoneGap that I can add to my app. I don't have a clue to program in Objective-C which is the main problem!!
Any ideas would be much appreciated.
Thanks
Nick
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://www.clearlyinnovative.com/reading-files-within-app-bundle-at-runtime-using-phonegap-and-javascript" clearinnovative.com/reading-files-within-app-bundle-at-runtime-using-phonegap-and-javascript
我写了一些东西来解决这个问题
http://www.clearlyinnovative.com/reading-files-within-app-bundle-at-runtime-using-phonegap-and-javascript
I wrote something to solve this problem