科尔多瓦3和FULLPATH
问题描述:
在科尔多瓦之前的版本/ PhoneGap的由FULLPATH和的toURL()上的一个文件或目录返回的URL返回(在Android设备)“文件:/// MNT/SD卡”。科尔多瓦3和FULLPATH
window.requestFileSystem(
LocalFileSystem.PERSISTENT,
0,
function(fs){
console.log(fs.root.fullPath);
console.log(fs.root.toURL());
},
function(error){
console.error('Failed to get file system:' + error);
}
);
使用科尔多瓦3.3.1-0.4.2上面的代码将返回:
02-20 15:56:56.746 I/Web Console(27239):/at file:///android_asset/www/js/ui.js:64
02-20 15:56:56.746 I/Web Console(27239): cdvfile://localhost/persistent/ at file:///android_asset/www/js/ui.js:65
这非常适合使用基于科尔多瓦的功能,但如果我想要一个URL传递给第三方库,该URL是没有意义的。 (我的例子是我有一个GPX文件存储在本地,我需要的位置传递到的OpenLayers层)
答
新cdvfile协议并不在机器人2的工作,为此该方法toNativeURL()已经被添加到所述org.apache.cordova.file插件1.0.1,见https://issues.apache.org/jira/browse/CB-6106。
答
其实并没有与版本科尔多瓦但插件的版本链接。你看过the release notes of the new version of the plugins?
(我必须承认这不是真的对我清楚无论是暂时)
雷蒙德·卡姆登做出a blog entry on the subject,也许你能问问题there?