Skip to main content
Participating Frequently
July 5, 2011
Question

URLLoader() throws IOErrorEvent on Android while connected by wireless

  • July 5, 2011
  • 1 reply
  • 1562 views

I'm having problems with my Android App when it's connected via Wireless networks.

It's on Market, you can try it: https://market.android.com/details?id=air.br.com.flexbrasilia.Postal&feature=search_result

You can try any these codes on it RT097046056HK, RA170864624CN and RT097660539HK.

If it shows you a message with an OK button, that it threw IOErrorEvent, if you get a list with the map, it worked.

I have an URLLoader to load an html page where I get the information I need parsing the html code.

It works fine when the phone is in 3G, but it doesn't work while connected to Wireless connections (altough it works when emulating via Flex Builder), it always return IOErrorEvent with an empty URLLoader (e.target).

Always had this problem. Tryed to update with Flex 4.5.1 and latest AIR, but it's the same.

Here's the code:

var request:URLRequest = new URLRequest(url+searchInput.text);

request.cacheResponse = false;

request.useCache = false;

var loader:URLLoader = new URLLoader( request );

loader.addEventListener(Event.COMPLETE, onLoadComplete);

loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);

loader.addEventListener(HTTPStatusEvent.HTTP_RESPONSE_STATUS, httpStatusHandler);

loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);

The url is http://websro.correios.com.br/sro_bin/txect01$.QueryList?P_LINGUA=001&P_TIPO=001&P_COD_UNI=

and searchInput.text means any of the tracking codes above.

Do I have to manage connection changes?

I have the same problem with another Android app I'm doing. But this app uses amfphp requests. Some times it works, most times not.

And the problem isn''t in my phone because I'm testing in differente Android phones (Xperia Arc and Milestone 2).

I've looking over the internet about this problem since Flex 4.0 preview and can't find anything.

UPDATE:

Well I put the problem in the wireless, but it also happens in 2G/3G. And I just found out that when my apps aren't working, the Tour de Mobile Flex AMF Remoting doesn't work also, it just stays "running test" forever because it doesn't catch the IO_ERROR. And of course, any other app that requires AIR won't be able to connect to the internet either.

I tryed clearing the data of every air app including Adobe Air in my phone and restarted it with Wireless shutdown in one and on in the other phone.

After restart both phones were running every air app like it should.

Then I changed the connection, turned wireless on in one and off in the other.

And in both phones the apps stoped working like they should (retrieving info from internet).

Well, now I know why 90% of the AIR Apps in Market are games and the other 10% has only 3 stars. Because people can't access the internet!!

And this problem is there since the Air for mobile launch. I can't believe it haven't being reported and dealt with yet.

This topic has been closed for replies.

1 reply

Inspiring
July 12, 2011

I use wireless all the time in my app and i never get an IOError on my Android phone... The issue must be specific to the way you implemented the call...

Participating Frequently
July 12, 2011

I don't see a way that would throw error in the phone and not in the emulator, but...

Anyway, I continued my tests and I figured that when my apps stop working, every AIR app stops connecting to the internet. Even Tour de Mobile Flex AMF Remoting stops working.

I also found out that it happens only in a couple of wireless networks (like mines). And the problem is that when that happens every AIR app stops working until you reboot the phone.

Weird thing is that every other app in the phone connects to the internet.

So there might be an issue with AIR that in some cases it get lost and don't know the active connection. Because I believe the IO_ERROR is being thrown because of connection timeout.

I just bought a new wireless router, will run some tests.

chris.campbell
Legend
July 14, 2011

Hi Daniel,

While I don't have an answer for you, I wanted to let you know that I've forwarded this post along to our mobile team.  We're just back from a week break so people are probably still catching up, but hopefully we'll hear something back soon.  If you haven't already, I'd also like to recommend adding a bug over at bugbase.adobe.com.

Thanks,

Chris