A simple search for "Illegal Character on the google groups site yields the following result: http://groups.google.com/group/android-beginners/browse_thread/thread/58a3721c0e7cb5cd/e2d94eac2c535240?lnk=gst&q=illegal+character#e2d94eac2c535240
And on stack overflow a search for "android illegal character uri" yields: http://stackoverflow.com/questions/559902/android-how-can-i-convert-android-net-uri-object-to-java-net-uri-object If you haven't searched already, please do so before posting. If you still can't figure it out, I'm sure we can help you. ---------------------------------------------------------------------- There are only 10 types of people in the world... Those who know binary and those who don't. ---------------------------------------------------------------------- On Tue, Mar 2, 2010 at 8:09 AM, wahib <wahib.t...@gmail.com> wrote: > hi experts !! > > I am stuck with this issue. I am trying to send a string to a url > which is like .... > http://10.3.12.165/android/geteventlist.php?event_search_string=<entered > by user in a edittext> > > it works fine if user enters a string without spaces. But as user > enters a string with spaces this error is posted in the logcat. > > java.lang.IllegalArgumentException: Illegal character in query at > index 71: > http://10.3.12.165/android/geteventlist.php?event_search_string=Concert > at LUMS > E/AndroidRuntime( 271): at > org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:75) > E/AndroidRuntime( 271): at > com.eventify.app1.listevents.geteventlist_fromDB(listevents.java:121) > E/AndroidRuntime( 271): at com.eventify.app1.listevents > $1.onClick(listevents.java:55) > E/AndroidRuntime( 271): at > android.view.View.performClick(View.java: > 2344) > E/AndroidRuntime( 271): at > android.view.View.onTouchEvent(View.java: > 4133) > E/AndroidRuntime( 271): at > android.view.View.dispatchTouchEvent(View.java:3672) > E/AndroidRuntime( 271): at > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) > E/AndroidRuntime( 271): at > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) > E/AndroidRuntime( 271): at > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) > E/AndroidRuntime( 271): at > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) > E/AndroidRuntime( 271): at > com.android.internal.policy.impl.PhoneWindow > $DecorView.superDispatchTouchEvent(PhoneWindow.java:1712) > E/AndroidRuntime( 271): at > > com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java: > 1202) > E/AndroidRuntime( 271): at > android.app.Activity.dispatchTouchEvent(Activity.java:1987) > E/AndroidRuntime( 271): at > com.android.internal.policy.impl.PhoneWindow > $DecorView.dispatchTouchEvent(PhoneWindow.java:1696) > E/AndroidRuntime( 271): at > android.view.ViewRoot.handleMessage(ViewRoot.java:1658) > E/AndroidRuntime( 271): at > android.os.Handler.dispatchMessage(Handler.java:99) > E/AndroidRuntime( 271): at android.os.Looper.loop(Looper.java:123) > E/AndroidRuntime( 271): at > android.app.ActivityThread.main(ActivityThread.java:4203) > E/AndroidRuntime( 271): at > java.lang.reflect.Method.invokeNative(Native Method) > E/AndroidRuntime( 271): at > java.lang.reflect.Method.invoke(Method.java:521) > E/AndroidRuntime( 271): at com.android.internal.os.ZygoteInit > $MethodAndArgsCaller.run(ZygoteInit.java:791) > E/AndroidRuntime( 271): at > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) > E/AndroidRuntime( 271): at dalvik.system.NativeStart.main(Native > Method) > > how would i convert the string to a format when it gives no exception. > The problem is that i have to pass this complete url string with > variable to HttpGet object like... > HttpGet request = new HttpGet(url); ///url is of type String > > so i have to pass it as a string type only. kindly help me out. > > Regards, > wahib > > > -- > You received this message because you are subscribed to the Google > Groups "Android Beginners" group. > > NEW! Try asking and tagging your question on Stack Overflow at > http://stackoverflow.com/questions/tagged/android > > To unsubscribe from this group, send email to > android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/android-beginners?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en