我正在使用 Phonegap 开发我的应用程序,所以我需要将 CSS、JS、JS 库、index.html 打包到 assets/www 文件夹中,并且
super.loadUrl("file:///android_asset/www/index.html",4000);
但有没有办法更新我的 CSS、JS、JS 库、index.html 而无需更新我的应用程序(不从商店或我们自己的服务器更新 apk 文件)——这是因为我需要与 native 交互的某些页面,它(CSS/JS,index.html)可能需要更改。
听起来很愚蠢,但是有没有办法满足这个要求,iOS 解决方案怎么样?
我读过这个: cannot modify the files in /android_assets/www with the File API , can't get a file object from an asset
但是,我找到了copy files in assets to sdcard .
那么,我可以通过某种方式更新 Assets 文件吗?或者这种听起来很愚蠢的方式(我不知道 iOS 解决方案):
1 复制到sdcard
2 更新 css/js/index.html
3 super.loadUrl("/mnt/sdcard/myapp/index.html",4000);
还有其他解决方案吗,THX?
最佳答案
对于 Cordova/Phonegap,它是可用的,contentsync 插件,用于下载远程资源和更新应用程序 Assets 或 Cordova 插件,无需商店重新发布。
关于android - 如何在 phonegap android 应用程序中更新 Assets 文件(js css 图像)而不更新我在 play/app store 中的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20715431/