0

I'm developing an android application using Flex Builder 4.6. It's fairly complicated app and I'm using HTTPService for communication with the server. It was working fine until recently it stops working after making the apk file. So From desktop simulator, in debug-mode in the mobile, the HTTTPService just works fine but when I make a release build and install it in the mobile, it just doesn't work.

I tried to track down the error, it's just simply shows 'HTTP request error'. For example here is the mxml code I'm using

<s:HTTPService id="sayHi" method="GET" result="sayHi_resultHandler(event)" fault="sayHi_faultHandler(event)"
                   url="https://zaawi.co.uk/developer/controller.php" useProxy="false">
        <s:request xmlns="">
            <h>sayHi</h>
        </s:request>
    </s:HTTPService>

I checked the url https://zaawi.co.uk/developer/controller.php?h=sayHi in the browser which works fine, as well as, in the simulator and debugging mode.

The server(php) sending response in xml format

print '<?xml version="1.0" encoding="UTF-8"?><data><hi>hello world</hi></data>';

It was working fine for almost a year and just stopped working recently.

Please let me know if anybody else had this problem and how can I resolve this.

Many thanks in advance

iamshahid
  • 469
  • 1
  • 3
  • 9
  • Have you tried Flash Builder's "Launch on Device" option to try it directly on an Android device? Does it work then? If not; can you turn on the Flash Builder Network monitor to monitor traffic? Since you're using HTTPS; are you sure that your cert is all set up? I've had odd issues w/ HTTPS calls on Android. – JeffryHouser Oct 04 '12 at 20:26
  • Thanks for your reply. The issue is all about https and there are hardly any solution. I tried adobe instructions for crossdomain.xml file, but which seems to be only effective for flash/flex web application. for android apk the server always reject the connection. without https the service work just fine. do you think there is a way round to allow https from android apk? Otherwise I won't have any choice but move my service files to a non-secure domain :( – iamshahid Oct 05 '12 at 22:10
  • Crossdomain.xml file won't apply for native apps; only for browser based apps. In my tests--quite a while ago--I got a popup from Android asking to accept the certificate of the HTTPS domain I was trying to access. I don't believe I ever found a solution; for my purposes HTTPS was not a requirement, so we ended up switching to HTTP b/c it was easier and quicker. Sorry – JeffryHouser Oct 06 '12 at 00:05
  • This issue is frustrating me as well. I wish Adobe hadn't thrown us under the bus. Whats interesting and different about my situation, is that it WORKS on my Kindle Fire. Other tablets fail. Could it be from that fact that Kindle Fire has the AIR Runtime pre-baked into the OS? Would that make a difference? Also see: http://stackoverflow.com/q/14970148 – PRB Mar 02 '13 at 21:39
  • Strange turn of events - I just figured out why this was failing for me. See here for my solution: http://stackoverflow.com/q/14970148 Hope that helps someone else watching this thread. – PRB Mar 02 '13 at 22:14

2 Answers2

0

I had a similar problem a while ago, my HTTPService requests started to fail and i didn't got anything useful in the FaultEvent, but after hours of trying different things i noticed that i had the network monitor enabled in flex, and since i had nothing to loose, i disabled it a voila! The app worked again!

I think when you have the network monitor enabled, the app redirects all requests thru a local proxy or something and that way you can sniff the requests, but this seems to stay when you create a release version and mess all requests.

So if you have network monitor enabled, just disable it, and then try to build your app again.

polloss
  • 406
  • 4
  • 7
  • hi polloss, while I appreciate your time for the answer, I've tried disabling net work monitor long ago, but it didn't solve this problem at all. Now I moved my service files to a non-secure domain. It did solve the problem, but extra security check is vital as the connection between client and server isn't secure anymore(I think we can live on it) – iamshahid Nov 03 '12 at 23:11
0

It appears that it is related to how the captive runtime calls https endpoints. Someone over on this thread Adobe AIR mobile app fails when using HTTPS on Nexus tablet, but works on Kindle figured out that by switching from the captive runtime to using the shared AIR runtime, the error went away. You may also want to try the latest AIR SDK and see if that solves the problem (although I've been seeing issues with the apps working on iOS using the 3.8 beta build, so you may want to try 3.7 first).

Community
  • 1
  • 1