Persona wrote: > Hello, the following code uses POST method to communicate with the Web > Server, and the response is displayed in the console (not parsed in a > Servlet, etc). When compiled as a java application, the program works > as expected returning the response as html text. > > My aim is to have an Android app that will communicate with servers > using various protocols- and I am using this as an example in learning > how that technique can be done. Therefore I would wish Android to get > the response, and displaying it in 'TextView?' or somewhere. I thought > this was going to be a straight-forward thing, but I have been stuck > at this point for days now. > > Can somebody assist if possible.
You should try some of the tutorials on http://developer.android.com. What you have is fine for desktop Java but bears little resemblance to an Android app, any more than it bears much resemblance to a Swing or SWT app. Step #1: Get the Hello, World tutorial working http://developer.android.com/guide/tutorials/hello-world.html Step #2: Read up on AsyncTask Step #3: Create an AsyncTask that, in its doInBackground() method, does your HTTP processing, and in its onPostExecute() method, updates the TextView widget -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 1.0 In Print! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---