Can I use Uri.Builder from Android SDK in Google App Engine (Java Project)

Go To StackoverFlow.com

0

I noticed the Uri.Builder in this answer And I wondered if I can use it in my GAE project in eclipse

I want to do something like

Uri.Builder b = Uri.parse("https://mydomain.com").buildUpon();
b.path("/abc/{5D/{B0blhahblah-blah}I1.jpg");
Uri u = b.build();

I cant find a way to add the Android SDK to my Google New Web Application Project

Is it possible and how?

Thanks in advance...I

2012-04-05 22:00
by Daniel


1

Uri.Builder creates Android Uri objects, not Java URI objects. You would need to:

  1. Grab the source code to Uri from the open source repository.

  2. Refactor it into your own package, probably.

  3. Remove everything that refers to other Android classes.

  4. Make any other modifications you feel you need to consume the resulting Uri objects.

2012-04-05 22:08
by CommonsWare
Thanks! Will check it out - Daniel 2012-04-06 11:12
The "Refactor it into your own package, probably." part is gonna be very unpleasant :/ seems like several/dozens of files will be needed to be included in my project.. :( cause they are a must in the Uri class.. - Daniel 2012-04-07 07:44
This is an awful lot of work just to construct URIs - Nick Johnson 2012-04-08 05:28
I'm not going to do it , At the time of asking I wasn't aware of the JAVA URLEncoder.encode(query, "UTF8"); existence.. - Daniel 2012-04-08 06:15
Ads