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. Forcing garbage collection to happen at convenient time

I have screen 1 of my app which I want to transition smoothly into
screen 2.

I want the transition to be smooth but I don't mind a slight pause
before or after the transition. Before the transition I dump a lot of
objects that are no longer needed from screen 1.

However, as luck would have it (!), the garbage collection almost
always takes place during the transition causing the frame rate to
drop and the transition looks terrible :(

Is there a way for me to either force the garbage collection to
complete before the transition or delay until after the transition is
finished? I have tried System.gc() in various places but it doesn't
seem to help performance.
--~--~---------~--~----~------------~-------~--~----~

2. About make installer_img command error for x86

Hi :

I download new source code on 2009.04.07 and I add three project (alsa-
lib,alsa_sound,eeepc) in local_manifest.xml.
Than I execute $TARGET_ARCH=x86 TARGET_PRODUCT=eee_701
DISABLE_DEXPREOPT=true make installer_img.

But it happen following error message.How can I fix this?

===================Error=========================================

Copy: out/target/product/eee_701/installer/root/system/xbin/strace
Copy: out/target/product/eee_701/installer/root/system/bin/netcfg
Copying installer base files...
Copy: out/target/product/eee_701/obj/lib/libdiskconfig.so -> out/
target/product/eee_701/installer/root/system/lib/libdiskconfig.so
Copy:  ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
Copy:  ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
Copy:  ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
Copy:  ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
Copy:  ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
Copy:  ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
Copy:  ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
Copy:  ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
Copy:  ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
Copy:  ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
Copy:  ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
make: *** [out/target/product/eee_701/installer/ramdisk-installer.img]
Error 1



--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. is an AppWidget Configuration Activity required?

4. Tearing issue with OpenGL

5. How does Market calculate popularity?

6. More help with hardware acceleration

7. How to use the make_boot_img.sh