please take a look and give an advise

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

please take a look and give an advise

Postby love_android » Wed Feb 10, 2010 10:19 am

I worte a script to connect to a servlet listenning on port 8083 to get info sent from an android program runnning on emulator. When I try to test URL on browser of andorid, it works ( goto code lines that I set debug) but when I use this script code, there is nothing happenning but there is no exceptions on android emulator side :(

URL servletURL = new URL("http://10.0.2.2:8083/Test/TestApp");
HttpURLConnection servletConnection = (HttpURLConnection)servletURL.openConnection();
servletConnection.setDoOutput(true);
servletConnection.setDoInput(true);
servletConnection.setUseCaches(false);
servletConnection.setDefaultUseCaches(false);

servletConnection.setRequestProperty("Content-type","application/x-java-serialized-object");
servletConnection.setRequestMethod("POST");
System.out.println("Connecting to Servlet");
//Send object to servlet
OutputStream os = servletConnection.getOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(os);
oos.writeObject("Testing post");
System.out.println("send to Servlet");
oos.flush();
oos.close();

any ideas from you ? please give me some advise
Thanks all
love_android
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Feb 10, 2010 10:12 am

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 8 guests