Space character in URI

by Beta Mike » Tue, 20 May 2008 21:27:25 GMT


Sponsored Links
 I need to incorporate a space character in a URI but android
automagicaly converts spaces into URL encoding (i.e. %20).  how can I
prevent this or encode  a link to the URI so that it is converted into
' ' not '%20'?

example:
i want - content://my app
don't want - content://my%20app

i know this sounds absurd but I need it to work this way.

any thoughts?
--~--~---------~--~----~------------~-------~--~----~



Space character in URI

by [EMAIL PROTECTED] » Wed, 21 May 2008 11:56:54 GMT


 a uri may never contain space characters... has nothing to do with
android but you should be thankful android do check for it.

.mattias rost



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. The process...stopped unexpectedly. Please try again

On Sun, Mar 1, 2009 at 6:22 PM, Kevin J. Brooks




An exception was thrown...




Repeat



     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


And your answer is...?

-- 

Faber Fedor
Linux New Jersey
http://linuxnj.com
faberfedor.blogspot.com

--~--~---------~--~----~------------~-------~--~----~

2. webview problems when rendering HTML and using loadData

I know that many of you know this already but I am making a post
because I spent 5 hours trying to figure out why loadData was not
working. This does not pop up easily in searches of the mailing list.

TAGS: webview background white android loadData

WebView momentContent =
                        (WebView) view.findViewById
(R.id.subscription_list_moment_webcontent);
WebSettings wsettings =
                        momentContent.getSettings();
wsettings.setJavaScriptEnabled(true);

//works great
//momentContent.loadUrl("http://www.momentarynow.com/app/public/
android/info_about.html");

//doesnt work exact same content WHY?
momentContent.loadData(
                                ResourceUtils.loadResToString(R.raw.content, 
mContext),
                                mimeType,
                                encoding);

====

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
.bg {
        font-size: x-small;
        background-color: #CC6600;
}
-->
</style>
</head>
<body class="bg">
foobar
</body>
</html>

unless you use the most simple html possible, like no style sheets,
backgrounds, etc, loadData seems to blow up. The only workaround I
have found is to use loadDataWithBaseURL instead


                final String mimeType = "text/html";
                final String encoding = "UTF-8";
                //render the html
                WebView momentContent =
                        (WebView) 
findViewById(R.id.subscription_list_moment_webcontent);
                WebSettings wsettings =
                        momentContent.getSettings();
                wsettings.setJavaScriptEnabled(true);
                momentContent.loadDataWithBaseURL("http://fake.com",
                                ResourceUtils.loadResToString(
                                                R.raw.content,
                                                getApplicationContext()),
                                mimeType,
                                encoding,
                                "http://fake.com");


oh now it magically works. but my forehead is a bit bruised from
hammering it against the brick wall.

I merely post to help others avoid my fate.

Clay



--~--~---------~--~----~------------~-------~--~----~

3. Android source code to find out which drawable a widget should use for its background?

4. imx31pdk

5. Android source code to find out which drawable a widget should use for its background?

6. Full-featured Android on x86-architecture from scratch

7. How to enable debug logging in android source