Copy link to clipboard
Copied
Hi guys
Just a quick question here. I'm developing an android app which requires a small amount of text data to be retrieved via a remotely hosted on a web server.
It works fine on a desktop machine but when it comes to testing it on a cellphone it refuses to load the XML file.
The data file I'm using is a simple XML file for now, but eventually it will be replaced with a PHP file which generates XML.
I'm uisng Adobe Flash Pro CS6 and have set the target to AIR 3.4 for Android. The INTERNET setting on the android permissions has been checked.
The code is a simple URLLoader as follows:
============================
private var _appDataXML:XML;
private var _xmlLoader = new URLLoader();
_xmlLoader.addEventListener(Event.COMPLETE, _onXMLLoaded, false, 0, true);
_xmlLoader.load(new URLRequest("http://www.example.com/data.xml"));
private function _onXMLLoaded(e:Event):void
{
_appDataXML = new XML(e.target.data);
_xmlLoader.removeEventListener(Event.COMPLETE, _onXMLLoaded);
}
============================
Is there any reason why this works on a desktop but fails to work when tested on a cellphone? Could I have missed something?
Any help would be appreciated. Thanks!
Copy link to clipboard
Copied
Have you checked that the app's permissions include Internet access?
Chris
Copy link to clipboard
Copied
Thanks for the response. I did as you asked and looked at the internet permissions which by the
way was already checked.
I then managed to solve this issue in a very bizarre way. I originally wrote the app in Flash CS5.
I recently purchased a subscription to Flash CS6 and after recompiling under CS6 it still exhibited
the same behaviour. But when I unchecked and then rechecked the internet permissions the app
somehow fixed itself and is now working.
Not sure what's going on here but it all seems OK now. Thanks!