FileTransfer.download()を使用しようとしていますが、何を試しても「エラーコード3」が表示されるようです。どんな助けでも大歓迎です。
私はcordova2.1とeclipe上に構築されたzendstudio10を使用して、マニフェストファイルとapkファイルを構築しています。
以下は私のコードです
var fileTransfer = new FileTransfer();
fileTransfer.download(
"http://www.w3.org/2011/web-apps-ws/papers/Nitobi.pdf",
"file:///sdcard/theFile.pdf",
function(entry) {
alert("download complete: " + entry.fullPath);
},
function(error) {
alert("download error source " + error.source);
alert("download error target " + error.target);
alert("upload error code" + error.code);
});
以下は私のcordovaxmlファイルです
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" id="com.phonegap.example" version="1.0.0" versionCode="1">
<name>App</name>
<feature name="http://api.phonegap.com/1.0/file"/>
<feature name="http://api.phonegap.com/1.0/network"/>
<feature name="http://api.phonegap.com/1.0/device"/>
<access origin=".*" />
</widget>
と私のアンドロイドmanifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.phonegap.example"
android:versionCode="1"
android:versionName="1.0.0"
>
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:configChanges="orientation|keyboardHidden"
android:name=".PhonegapActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
また、アプリケーションタグにandroid:debuggable="true"を設定してみました
どんな助けでも大歓迎です