Android Question how to access the java URI.BUILDER with B4A?

Discussion in 'Android Questions' started by DavideV, Mar 15, 2018.

  1. DavideV

    DavideV Active Member Licensed User

    Hello people,
    i would like to access the Java uri.builder scheme like this below:

    Code:
    Uri.Builder directionsBuilder = new Uri.Builder()
            .scheme(
    "https")
            .authority(
    "www.google.com")
            .appendPath(
    "maps")
            .appendPath(
    "dir")
            .appendPath(
    "")
            .appendQueryParameter(
    "api""1")
            .appendQueryParameter(
    "destination", lat + "," + lon);
    Is there a way to do this with B4A (maybe using javaobject)?

    Thanks in advance
    Davide
     
  2. DonManfred

    DonManfred Expert Licensed User

    You just can create the url by yourself. Using okhttp and parametrized parameters you don´t need to do anything special...

    A sample url is like

    Code:
    Dim job As HttpJob
        job.Initialize(
    "direction",Me)
        job.Download2(
    "https://maps.googleapis.com/maps/api/directions/json",Array As String("origin""New York, NY""destination""Boston, MA","waypoints","optimize:true|Providence, RI|Hartford, CT","key","yourkey"))
    You also can use Javaobject or Inline JAva.
     
    Last edited: Mar 15, 2018
    DavideV and Erel 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