What a pleasure to submit a code that doesn't work on Android
■ I'm testing the creation of a text file on Android with the Cordova-plugin-file.
The plugin is initialized correctly.
■ Here's the problem.
This line calls a JavaScript function on success that is not recognized.
Code: Select all
! window.requestFileSystem(window.PERSISTENT, 0, successCallback, errorCallback)
■ The codeReferenceError: successCallback is not defined
at f_start (spiderbasic.js?t=1725521373:378:49)
at Channel.onDeviceReady (spiderbasic.js?t=1725521373:390:1)
at Channel.subscribe (cordova.js:802:21)
at document.addEventListener (cordova.js:125:34)
at document.addEventListener (cordova.js13)
at SpiderLaunch (spiderbasic.js?t=1725521373:386:10)
at SpiderMain (main.js?t=1725521373:31:9)
at Channel.onDeviceReady (index.html:13:91)
at Channel.fire (cordova.js:872:23)
at cordova.js:232:49
SpiderMain @ main.js?t=1725521373:40
debug.js?t=1725521373:59 C:\SpiderBasic Project\Files\Write file.sb:18 successCallback is not defined
Code: Select all
EnableExplicit
Declare Start()
;Import Cordova Plugin
Import "cordova plugin add cordova-plugin-file"
EndImport
!document.addEventListener("deviceready", onDeviceReady, false);
!function onDeviceReady() {
! alert("Plugin initialisé")
Start()
!}
Procedure Start()
Debug "Start()"
! window.requestFileSystem(window.PERSISTENT, 0, successCallback, errorCallback)
EndProcedure
!function successCallback(fs) {
! alert("File : " + fs.name);
!}
!function errorCallback(error) {
! alert("Error : " + error.code);
!}
PS: If you have a method for writing files in Android,I accept your solutions