URLLoader() throws IOErrorEvent on Android while connected by wireless
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.
