Description
Hi
It could be nice feature apart to app.loadURL()
to have also possibility to send to or view resource externally using android built-in app chooser having something like app.sendURL()|app.viewURL()
.
For now I do it on back process level by spawning ActivityManager process:
// view/index.html
document.querySelectorAll('#upload a').forEach(a => a.addEventListener('click', e => {
e.preventDefault();
front.send('view', e.target.href);
})));
// main.js
back.on('view', file => require('child_process').execFile('am',
[...'start --user 0 -a android.intent.action.VIEW -d'.split(' '), file],
err => err && back.send('error', err)));
Metadata
Metadata
Assignees
Labels
No labels
Activity
Chhekur commentedon Dec 4, 2020
Hey @PawelSuwinski,
I am actually thinking to work on this for a long time but I didn't get a chance to work on this, if someone can contribute to the project and raise a PULL request will be the fastest way to build this.
But yeah I'll try to implement this as soon as I get time to work on this ; )
PawelSuwinski commentedon Dec 5, 2020
I am rather on basic level with Java and Android SDK so I will not try to do any contribution, but I think good starting point could be with
TermuxOpenReceiver
implementation:https://github.com/termux/termux-packages/blob/master/packages/termux-tools/termux-open
https://github.com/termux/termux-app/blob/master/app/src/main/java/com/termux/app/TermuxOpenReceiver.java
PawelSuwinski commentedon Dec 6, 2020
After all I will try to, it could be some challange, but based on
am
system command execution by implementingapp.exec()
:#60 (comment)