我正在使用phonegap for android应用程序来获取外部卡,
我正在使用此代码:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Hello World</title>
<link rel="stylesheet" href="css/index.css" type="text/css" />
<script src="js/jquery.js" type="text/javascript"></script>
<script src="cordova.js" type="text/javascript"></script>
<script type="text/javascript">
window.appRootDirName = "app";
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log("device is ready");
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
alert(window.appRootDir.fullPath);
}
function fail() {
console.log("failed to get filesystem");
}
function gotFS(fileSystem) {
console.log("filesystem got");
window.fileSystem = fileSystem;
fileSystem.root.getDirectory(window.appRootDirName, {
create: true,
exclusive: false
}, dirReady, fail);
}
function dirReady(entry) {
window.appRootDir = entry;
console.log("application dir is ready");
}
</script>
</head>
<body>
</body>
</html>
它的回报file://mnt/sdcard/app
- 这是我的内部电话存储路径外部路径是file://mnt/ext_card/app
如何在 phonegap 中获取外部卡路径?