• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Help - Loading Remote XML/PHP File On AIR For Android

New Here ,
Dec 14, 2012 Dec 14, 2012

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!

TOPICS
Development

Views

2.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2012 Dec 14, 2012

Copy link to clipboard

Copied

Have you checked that the app's permissions include Internet access?

Chris

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 15, 2012 Dec 15, 2012

Copy link to clipboard

Copied

LATEST

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines