B4J Question Open URL with defaut browser

Discussion in 'B4J Questions' started by Douglas Farias, Aug 23, 2015.

  1. Douglas Farias

    Douglas Farias Expert Licensed User

    How can i open a especific url on a defaut browser?
    for example if user use google chrome, open on the url on the chrome
    if use firefox by default , open a url in firefox.

    how can i make this like the b4a?
     
  2. Roycefer

    Roycefer Well-Known Member Licensed User

    If you are creating a UI app, use:
    Code:
    fx.ShowExternalDocument("http://buttdroid.itch.io/unreal-tournament-2004-cache-extractor")
    If you are creating a non-UI app, you have to use the jAWTRobot library and call
    Code:
    robot.SystemOpenAddressInBrowser("http://buttdroid.itch.io/unreal-tournament-2004-cache-extractor")
     
  3. Douglas Farias

    Douglas Farias Expert Licensed User

    Thx man, i never see this comand
    ShowExternalDocument
    the name its strange for browser function.

    thx again
     
  4. Roycefer

    Roycefer Well-Known Member Licensed User

    It's not just for browser functions. It will open any external file with the system's default application for that file type.
    jAWTRobot's
    Code:
    robot.SystemOpenExternalFile(File.Combine(File.DirApp, "hello.txt"))
    will do the same in non-UI apps.
     
    Roger Daley, Erel and Douglas Farias like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice