8 Replies Latest reply: May 4, 2012 6:29 AM by sinious RSS

    Optimizing Flex Mobile Applications(not Games)

    rjoshicool Community Member

      I have now been developing aplications for Mobile devices using Flex framework for quite a  while and published 3-4 apps to marketplaces. But if we see the performance of the AIR apps as compared to the Native ones, its still not that much smooth.

      Any idea how I can optimize the Flex applications? There are resources avaialable for optimizing games but in case of Apps it is something different. The issues are like, buttons are not sometimes that much responsive to touch events, the screen transitions are not that smooth etc.

      Also I would like to know how to create Apps using only ActionScript as I guess they might be smoother as compared to the Flex version. But if it is created using AS3 only, how to best manage the screens so that they don't take up too much memory and give native like performance.

        • 1. Re: Optimizing Flex Mobile Applications(not Games)
          Zhenya1919 Community Member

          I've been working on Flex mobile applications (not games) for quite some time now as well. I couldn't achieve the performance of a native application of course. But I think the execution is still smooth enough most of the time.

          The universal answer to your question is to use the Profiler in Flash Builder and fix the performance problems you find in your action script code. Make sure that your profiler is set up to show Flash SDK code as well. Because that's where sometimes the problem is. That's the easiest step. And it can be the most efficient one because as I discovered myself the performance of ActionScript code on mobile devices is quite dissappointing. The next step would be optimizing [render] and [pre-render] phases of the execution. You can easily find ton of information on that on the Internet.

          • 2. Re: Optimizing Flex Mobile Applications(not Games)
            sinious CommunityMVP

            You can't achieve native performance in most situations. Doing anything ARM/Flash-centric you will always find spark native components are slower than their native counterparts. Even hand-coding them (e.g. blitting) will get you no more performance, just more lines of code and more headaches.

             

            This should be obvious.

             

            Aside that you need to weigh in that the code base you build for your app can mostly be used to output an app for several other targets (if you speak XCode). AIR for IOS, Android and Blackberry. That's both phones and tablets. Also Desktop Mac OSX and Windows as well as the Web (without AIR).

             

            So if you want native performance, be prepared to build your app from scratch several times. The performance loss of going the Adobe route gives you the flexibility of exporting your app to multiple targets. That justifies the so-called "boggy" performance for me and my multi-billion dollar clients.

            • 3. Re: Optimizing Flex Mobile Applications(not Games)
              Zhenya1919 Community Member

              That's actually the only reason why my client decided to use AIR to develop for mobile. a) we had a failry big code AS3 base and b) they wanted to target multiple platforms at once. Including Web and potentially native installer on Mac. From the very beginning we expected the performance to be worse than for native applications. But that was the price they agreed to pay.

              • 4. Re: Optimizing Flex Mobile Applications(not Games)
                sinious CommunityMVP

                So you get what you correctly informed your clients of. Sub-par performance. What's the question then?

                • 5. Re: Optimizing Flex Mobile Applications(not Games)
                  Zhenya1919 Community Member

                  Oh, no. I don't have any questions. :-) I just tried to help the topic's starter.

                  • 6. Re: Optimizing Flex Mobile Applications(not Games)
                    sinious CommunityMVP

                    OP: AIR for iOS will be a bit boggier than native, outside the components that are invoked via AIR that are native, like StageVideo and StageWebView, etc.....

                    • 7. Re: Optimizing Flex Mobile Applications(not Games)
                      rjoshicool Community Member

                      As per the above discussion, I guess we can only perfomr few tweaks and optimizations to make it work bit smoother but would not be able to make it as smooth as the native ones.

                      • 8. Re: Optimizing Flex Mobile Applications(not Games)
                        sinious CommunityMVP

                        The original post said there's updaes for games but (spark) components don't feel native.

                         

                        Then realize the GPU is about 25 gigaflops faster per second and utilize it.