Help - Loading Remote XML/PHP File On AIR For Android
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!
