android-js / androidjs

Platform to build android app using node js
MIT License
466 stars 109 forks source link

I don't understand how to create a file and to access it #235

Closed pedefe closed 2 years ago

pedefe commented 2 years ago

Hello,

I see the API app.getPath() which allow to know some specific paths of smartphone. I call app.getPath('userData') in my web page (front app), and I get "/storage/emulated/0/Android/data/com.androidjs.webview/files"

But for me the web-page cannot write directly in a file.... For exemple, 'fs' is not available....

On over side, how the 'back' side (the nodejs process) can use app.getPath() in order to know the paths of the smartphone ?

Thank for help.

Chhekur commented 2 years ago

@pedefe correct, so what you can do is invoke app.getPath() in front and send it back via IPC and write the data to the file.

pedefe commented 2 years ago

Thank you.