1. Are you ready for the Galaxy S20? Here is everything we know so far!

Encoding in uri.buider

Discussion in 'Android Development' started by AlexeyS, Jul 10, 2017.

  1. AlexeyS

    AlexeyS Newbie
    Thread Starter

    Hello, i have a question about encoding of uri.builder.
    I created an uri with uri.builder. the problem that one of my parameters values includes comma.

    .appendQueryParameter("locatiion",-25.654, 45.98)

    so builder replace comma with hex value(%2C). To repair this link, i wrote replace function.

    But i want to use Encoding. here is my new url. But something wrong with it, i don't get results using it.
    url = new Url(URLDecoder.decode(builder.build().toString(), "UTF-8"));

    Thank you

    1. Download the Forums for Android™ app!



Share This Page