cordova - android phonegap FileTransfer.download() recieving error code 3 -
i trying utilize filetransfer.download() seem "error code 3" no matter try. help appreciated.
i using cordova 2.1 , zend studio 10 built on eclipe build out manifest , apk files.
below code
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); });
below cordova xml file
<?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>
and android 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>
i have tried setting android:debuggable="true" in application tag
any help appreciated
so found problem. cors issues
i had right setting in cordova config.xml
<access origin=".*" />
however, when zend studio built out android project setting did not transferred on res/xml/config.xml
after adding access origin line in file started working expected.
android cordova file-transfer
No comments:
Post a Comment