I'm writing a script to run on android's terminal and I need it to open the browser and a URL. I managed to open the browser but didn't find a way to put the URL on it.
am start -a android.intent.action.MAIN -n com.android.browser/.BrowserActivity;
Appreciate any help : )
On Linux, the xdc-open command opens a file or URL using the default application. To open a URL using the default browser… On Mac, we can use the open command to open a file or a URL using the default application. We can also specify what application to open the file or URL.
xdg-open command in the Linux system is used to open a file or URL in the user's preferred application. The URL will be opened in the user's preferred web browser if a URL is provided. The file will be opened in the preferred application for files of that type if a file is provided.
Just use Intent.ACTION_VIEW
(i.e. android.intent.action.VIEW
), e.g.:
am start -a android.intent.action.VIEW -d http://www.xing.de
This way the XING site is started. If you have more than one browser installed, you can of course add the component name of the browser you want to start, e.g.:
am start -a android.intent.action.VIEW
-n com.android.browser/.BrowserActivity -d http://www.xing.de
Cheers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With