HttpConnection Intermittent Poblems

by Ryan » Fri, 06 Mar 2009 02:22:32 GMT


Sponsored Links
 Hi,

My app uses a simple HttpConnection to download and parse some XML
that I host. The important code is as follows:-

                URL url = new URL(urlStr);
                URLConnection connection = url.openConnection();
                HttpURLConnection httpConnection = (HttpURLConnection)
connection;
                int responseCode = httpConnection.getResponseCode();

                if(responseCode == HttpURLConnection.HTTP_OK) {
                        // do useful stuff here
                }
                else {
                                               // display connection
failed error message here
                }

This works all the time on my G1 (based in UK), but a number of my
users are complaing they always see the connection failed message.
This is even though they have 3G connections and can browse the
internet, use google maps etc.

Can you see that I'm doing something obviously wrong?

Is there a more robust way to connect?

Any advice greatly appreciated,

Ryan


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



Other Threads

1. android canvas

hi,
Does android supports canvas application. Does it contains Graphics
and Canvas API
as J2ME package. How to develop canvas applications in android.

Rajib
--~--~---------~--~----~------------~-------~--~----~

2. Can anybody describe a little bit more details about android build structure?

The build structure is quite complicated in android, there seems many
variations and targets, and it is not easy to even know which files
are actually built, which are not. can anybody explain it a little bit
about it? Or there is some docs from Google for it? Thanks. To
understand the build structure is very helpful to port to your system.
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [EMAIL PROTECTED]
website: 

3. Can the software stack be compiled to run on a PowerPC?

4. Android openGL and Google Sketchup

5. video capture

6. Office Suite

7. Saving a file to a system directory?