10 Replies Latest reply on Feb 19, 2013 11:54 PM by Dudile

    AIR 2.6 / AIR 2.7: Very slow image load with StageWebView object in iOS (it's fast in Android)

    OMA2k Level 1

      I'm having a performance problem with a long page with 300 small images (100x100 pixels each) shown through a StageWebView object.

       

      In Android 3.0 that page is shown very fast, almost instantly. Even if I scroll down very fast to the bottom, the last of the images can be seen with no wait at all (those images load from a Intranet (LAN) page, so it should load fast anyway).

       

      But the same app in iOS takes almost a minute to load all images in that page. This is a problem because it's a scrolling list which can be jumped alphabetically, so if someone jumps to letter Z before all images have loaded, then he/she will see empty items until a lot of time later (seconds might not sound like much, but they're essential for user experience, and this long a wait might make the user think the app is broken).

       

      So, is there any way to improve image loading performance of the StageWebView object in iOS? (for iPad 2)

        • 1. Re: AIR 2.6 / AIR 2.7: Very slow image load with StageWebView object in iOS (it's fast in Android)
          chris.campbell Adobe Employee

          Thanks for the heads up.  I'm forwarding this along to the iOS team for their review.  Is there any chance we could get a copy of your project or some sample code that would allow us to reproduce the issue?  You can either create a new bug at bugbase.adobe.com and attach the sample code or you can email it to me at ccampbel@adobe.com.

           

          Thanks,

          Chris

          • 2. Re: AIR 2.6 / AIR 2.7: Very slow image load with StageWebView object in iOS (it's fast in Android)
            Saumitra Bhave Level 3

            Hi:

             

            Can you provide me following information.

             

            When you load the same page in Default Android Browser and iOS Safari browser. Do you see the same behaviour? (i.e. Safari loads slowly and Android browser loads faster?) or Both load faster in their default browser?

             

            Thanks,

            Saumitra Bhave

            AIR iOS

            • 3. Re: AIR 2.6 / AIR 2.7: Very slow image load with StageWebView object in iOS (it's fast in Android)
              OMA2k Level 1

              Hello, I've tried in the Android browser and in the iOS Safari browser, and certainly, the experience is very similar:

               

              - Android takes 3 seconds to load the 300 images

              - iOS takes 30 seconds, and if you scroll the page, it pauses loading until you stop scrolling

               

              So it seems the slowness is due the Safari object used by StageWebView . The only solution I could come up with has been creating a second StageWebView object off-screen which loads a special page that just contains all the possible images at once, with no interface, while the user is interacting with other stuff in the AIR application, so when the moment comes that the list should be shown to the user, the images are cached and load as fast as in Android. But this is hack that only works if the user takes time to reach that list page. If the list is shown early after loading the app, the problem still arises, since the "cache page" has to load a huge amount of images, since you don't know what the user will choose to browse.

               

              This slow image load seems to be a common issue with Safari:

              http://forums.macnn.com/82/applications/318950/safari-slow-load-images-really-slow/

               

              Is there any alternative browser Adobe could use for StageWebView instead of Safari?

               

              Well, I'm not sure there is even an alternative browser for the iPad, since Apple doesn't allow applications that load interpreted code, and just about any browser uses JavaScript, which is interpreted code. That's why there is still no Firefox for iOS.

               

              I know Opera Mini is allowed in iOS because the JavaScript is interpreted in Opera's servers, but I'm not sure if Opera could communicate JavaScript with AS3 using the server approach.

               

              Damn Apple and their stupidly restrictive policies (you know it too well, since Adobe AIR was banned from iOS by Apple for some months last year!)

              • 4. Re: AIR 2.6 / AIR 2.7: Very slow image load with StageWebView object in iOS (it's fast in Android)
                Saumitra Bhave Level 3

                Yes, thats correct AIR uses the native web components of the platform so there is very less that can be changed by air.

                 

                For a workaround can you change the html source as u said site is on the intranet?

                 

                Sent from my Android phone.

                • 5. Re: AIR 2.6 / AIR 2.7: Very slow image load with StageWebView object in iOS (it's fast in Android)
                  OMA2k Level 1

                  SaumiB wrote:

                   

                  Yes, thats correct AIR uses the native web components of the platform so there is very less that can be changed by air.


                   

                  Would it be possible to use an alternative browser, if it exists?

                   

                  Well, the only reason I'm using StageWebView is to use the native iOS scroll

                  (scrolling 300 images in the iPad is too much, even for the iPad 2 on AIR 2.7,

                  which is the fastest hardware and AIR version; I even tried making invisible

                  the elements which fall off-screen, but still it's not anywhere near the

                  great performance of the native scroll, so:

                   

                  Would it be possible for you to implement a method in AIR to use the native iOS scroll?

                  (not the Safari browser, just the native scroll, so a MovieClip/Sprite can be scrolled).

                   

                  For a workaround can you change the html source as u said site is on the intranet?

                   

                  Yes, I can. What for? Maybe reducing number of images in the page?

                  Well, I guess I could add pagination with Next / Previous buttons,

                  but that's less convenient than a single randomly jumpable page.

                  I think I'll stick for now to the "cache" approach I commented in

                  my previous post.

                  • 6. Re: AIR 2.6 / AIR 2.7: Very slow image load with StageWebView object in iOS (it's fast in Android)
                    Saumitra Bhave Level 3

                    You can add some js to preload images and show some kind of loader by that time.

                     

                    Sent from my Android phone.

                    • 7. Re: AIR 2.6 / AIR 2.7: Very slow image load with StageWebView object in iOS (it's fast in Android)
                      OMA2k Level 1

                      Thanks for your answer. Well, it's a possibility, but I don't think it's a good idea to make the user wait 30 seconds plus the time it takes to load the actual HTML page before letting him/her interact with the page.

                       

                      If you mean loading the page before it's shown, it can't be done, because we don't know what the user is going to browse until the list is asked (it's a dynamic list rendered with PHP), so the only option is preloading in the background ALL possible images when the app is started, which takes a little while.

                      • 8. Re: AIR 2.6 / AIR 2.7: Very slow image load with StageWebView object in iOS (it's fast in Android)
                        Peter Blazejewicz Level 4

                        Hi,

                        @OMA2k

                        something not mentioned I think: 'cause you're using 2 devices - are they using the same network access? E.g. the same EDGE or 3G or Wi-Fi connection? (and in case of data network: the same mobile carrier?)

                        (edit: I've seen you mentioning LAN now, but just to be sure)

                        regards,

                        Peter

                        • 9. Re: AIR 2.6 / AIR 2.7: Very slow image load with StageWebView object in iOS (it's fast in Android)
                          OMA2k Level 1

                          Peter Blazejewicz wrote:

                           

                          Hi,

                          @OMA2k

                          something not mentioned I think: 'cause you're using 2 devices - are they using the same network access? E.g. the same EDGE or 3G or Wi-Fi connection? (and in case of data network: the same mobile carrier?)

                          (edit: I've seen you mentioning LAN now, but just to be sure)

                          regards,

                          Peter

                           

                          I'm using the same Wi-Fi conection for both devices. The slowness seems to be a Safari issue. Since Apple doesn't allow Internet browsers other than their own Safari browser, I'm afraid this can't be fixed, unless Apple releases a faster Safari browser in future OS updates.

                           

                          It would be great if Adobe implemented the native iOS scroll without the need of using an internet browser at all. That is, being able to scroll a movieclip or sprite with the native scroll, instead of having to create a HTML page to display a scrolling list.

                          • 10. Re: AIR 2.6 / AIR 2.7: Very slow image load with StageWebView object in iOS (it's fast in Android)
                            Dudile

                            Hi Guys -

                             

                            we have the same issue with web site having 90 assets and it takes it around 90 sec to load up completely (we do have preloader)

                            The problem it takes 1 minute to load and since this site is authenticated it failed with the authentication.

                             

                            Another issue we have is that somehow the site is not cached on the browser, so using pixel to load it up - not working for us

                             

                            We are using AIR 3.5 with iPhone 5.

                             

                            Do you happen to have any other tweak here?

                             

                            Thanks!