Skip navigation
Mr Draust
Currently Being Moderated

URLLoader on Mobile Device in AIR app

Jul 7, 2011 12:03 AM

Hello,

 

Im trying to get some response text (xml to be precise) from a server in my AIR app. If i send a GET request to the server, it should send me back some XML so i can process it. This is all done via a Mobile Application in AIR.

 

It runs perfectly on my PC but as soon as i try it on my Android Tablet, it just doesnt work.

 

What ive tracked it down to, is for some reason, as soon as i put a method typee such as POST or GET, into the URLRequest object, it just doesnt return any data. And i cant figure out why its not returning data.

 

Heres the code:

 

private function login(url:String):void
{

  var req:URLRequest = new URLRequest(url);
  var loader:URLLoader = new URLLoader();

  req.data = "";
  req.method = URLRequestMethod.POST;
                   
  urlLoader.addEventListener(Event.COMPLETE, handler);
  urlLoader.load(req);  

}

 

Just doesnt make sense why it would not return data, if i run it on my mobile device.

 

Any ideas?

 
Replies
  • Currently Being Moderated
    Jul 7, 2011 12:51 AM   in reply to Mr Draust

    Hi,

    #1

    can you check if "INTERNET" Android permissions is selected in your project settings? (or check it manually in your app.xml):

    http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-5d0f4f25128cc 9cd0cb-7ffc.html#WS901d38e593cd1bac1e63e3d129d39606f2-8000

    #2

    it does not return data - but does it reach server? (are you able to log that?)

     

    kind regards,

    Peter

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 7, 2011 12:56 AM   in reply to Mr Draust

    Do you get ay errors or something?

    C

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 16, 2011 4:56 AM   in reply to Mr Draust

    I have the same problem, did anybody fix it?

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 27, 2013 8:23 PM   in reply to Mr Draust

    I know this is probably 2 years too late for you, but figured I'd post as someone appears to have figured out what the solution may be.

     

    When I was debugging this, I was pinging https://parse.com.  When I tried google, everything seemed to work, so initially I thought it was Parse's servers doing something strange.  I then tried https://www.facebook.com to check if it was something to do with the ssl.  So when I did this, I got the same issue as with Parse.  Finally able to narrow down what I was googling for I came across a post over at stackoverflow.

    http://stackoverflow.com/questions/14970148/adobe-air-mobile-app-fails -when-using-https-on-nexus-tablet-but-works-on-kindle

     

    So apparently the issue is with the captive runtime.  I have yet to try using the updated 3.8 AIR SDK (going to try that soon), but using the captive runtime compiled with the 3.8 SDK may be a solution to this problem.  If that doesn't work, just try to package your Android apps without the captive runtime and get the end user to install the AIR package separately (not an optimal solution, but may work for most).

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points