Please help me with native file

this.file.readAsText(this.file.externalRootDirectory + “xtracker”, filename).then(???)

i want to read a json from android sdcard/xtracker and then JSON.parse it.

but i dont know how the promise resolves

writing the file works , but i dont know how to read it correctly please replace the ??? in the code so i get the filecontent as text

thanx !

Break it down into smaller pieces, once you do the reading part, what do the results give you?

this.file.readAsText(this.file.externalRootDirectory + “xtracker”, filename)
  .then(res => console.log(res))

Try a few things out first and you’ll be able to figure it out for yourself.

1 Like