android-js / androidjs

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

How to transfer const from main.js to index.html #234

Open random9brat opened 2 years ago

random9brat commented 2 years ago

Hi guys, im new here. Few weeks ago started using this framework and i like it :).

Since im new i really dont know how to send one variable from main.js back to index.html. I got function installed and i want to send some value from that function to index.html. I can see it can be done by using IPC (Inter Process Communication) but i really cant understand them and how you connect front processes with back processes.

So if anyone can explain to me and write some simple back.on, back.send, front.on, front.send examples i would really really appreciate it.

Thanks a lot :)

Level0r0s commented 2 years ago

see the video at https://www.youtube.com/watch?v=QplPXM0lhKA&t=1012s todo method front.send('[method Name]', ... has an automatic calback front.on('[methodName]-result',... method name followed by -result

image