B4J Question Open external browser from non-UI app

joseluis

Active Member
Licensed User
Longtime User
Hi,

I'm trying to open a webpage from a non-UI application (to test a REST API library I'm making) . Is it even possible?

I know I can't use jFX' ShowExternalDocument() for obvious reasons, but I'm also out of luck using jSHELL, since it's not opening anything. Even when I run the jar natively it does nothing. e.g.:
B4X:
Dim sh as Shell
sh.Initialize( "Browser", "/usr/bin/google-chrome", Array As String ("http://www.google.es") )

Is there something else I could try? Thank you

EDIT: Don't worry, I am an idiot. I just found out I have to use the Run method. :rolleyes: Now it works perfectly:
B4X:
sh.Run( -1 )

PS It would be fantastic if threads could be deleted by the author in the first 5 minutes...
 
Last edited:

joseluis

Active Member
Licensed User
Longtime User
I need to open it because it needs interaction with the user, so he can login in his account using OAUTH method, and then my program will receive a token, via a localhost server configured as the redirect_uri for the OAUTH process. This is the most convenient method I've found so far.

When the library is finished, the browser part will be handled by the program that uses it, e.g. opening a webview, but until then it is very convenient to do it all from the same code.
 
Upvote 0
Top