5 Replies Latest reply on Jan 12, 2011 11:57 AM by Richard Perrett

    Converting Burrito Flex Mobile App to Desktop

    Richard Perrett

      Hi Guys!  Have just developed an app for Android using Burrito.  It works nicely on a phone but it is also great as a little 'widget like' desktop app.

       

      Is there any way to package it so that it may be distributed as an Air app that runs exactly like it does when run in emulation mode (adl) from Flash Builder?  If not, what is the simplest path to convert the <mobileApplication> to a <windowedApplication>?

       

      Thanks,

       

      Richard

       

      Update:  Surprised no one has answered this.  I am new to Flash Builder and I figured you guys would know.  Have been looking at viewstacks in standard Air apps and trying to figure how to use this to achieve the same effect as a mobile app.  Looks like quite a lot of work to rewrite the app to Air on the Desktop ... is there an easier route .... anyone?

        • 1. Re: Converting Burrito Flex Mobile App to Desktop
          ghess01-vU69wO

          Hi Richard,

           

          I would also like to deploy my mobile application to the desktop, did you figure out how to do it?

           

           

          Thanks,


          Greg

          • 2. Re: Converting Burrito Flex Mobile App to Desktop
            Richard Perrett Level 1

            Greg,

             

            I have come up will a solution but it is not that quick to implement as there seems to be no automated migration route.  I had to go and learn about 'classic' air apps and create one.  I then used the air viewstack concept to replace the views in my mobile app. Essentially I ended up with a header panel with a set of views on a stack below this that corresponds to the action bar and views in the mobile app. 

             

            Points to note:  If you want the run the app at about the same physical size as on you phone you with have to reduce the window size of you air app compared with the phone as the pixel density is greater on the phone. For graphics to render nicely this will mean some managed scaling of images.

             

            Hope this is useful

             

            Richard

            • 3. Re: Converting Burrito Flex Mobile App to Desktop
              ghess01

              Thanks Richard,

               

              Yes, your experience is very helpful.

               

              I was hoping to be able to just 'package' the moble.swf as an air app and deploy. When I was first learing about Mobile develpement in Flash I had been using a .bat file downloaded from some Adobe resource 'packageApplication.bat' that I would run after compiling my application out to a .swf and it would then take that .swf and create two deployments, one for AIR and one for Android.

               

              Now that I am using Flash Builder Hero and Buritto I have all this packaging going on for me by the IDE. So I have been trying today to simply use my old 'packageApplication.bat' to do the same for my Hero mobile application. It KINDA works, being that I can take my moble applications .swf and package an AIR application(.air) and a mobile application (.apk). The .apk packaged works fine manualy installed to a mobile device, however the .air installs but does not launch when executed... nothing happens, seems to exit right away.

               

              Did you ever try this aproach? Do you know why it is not working?

               

              Cheers,

               

              Greg

              • 4. Re: Converting Burrito Flex Mobile App to Desktop
                ghess01 Level 1

                Hi Richard,

                 

                I was able to complile and deploy my Android app using command line air/android packaging and adding required air swc's to my project. I used the following packageApplication.bat(downloaded from livedocs) to package my MobileApplication as both an air app and android:

                 

                 

                :: AIR application packaging
                :: More information:
                :: http://livedocs.adobe.com/flex/3/html/h ... ml#1035959

                 

                :: Path to Flex SDK and ANDROID binaries
                set PATH=%PATH%;C:\Program Files (x86)\Adobe\Adobe Flash Builder Burrito\sdks\4.5.0\bin;C:\Program Files (x86)\Adobe\Adobe Flash Builder Burrito\jre\bin
                :: commented   set PATH=%PATH%;C:\PATH_TO_YOUR_ANDROID_SDK\android-sdk-windows\tools

                 

                echo PATH Set to %PATH%

                 

                :: Signature (see 'CreateCertificate.bat')
                set CERTIFICATE=testCert.p12
                set SIGNING_OPTIONS=-storetype pkcs12 -keystore %CERTIFICATE%
                if not exist %CERTIFICATE% goto certificate

                 

                echo CERTIFICATE_FILE: %CERTIFICATE%

                 

                :: Output AIR
                if not exist air md air
                set AIR_FILE=air/FlashClientMobile.air

                 

                echo AIR_FILE: %AIR_FILE%

                 

                :: Output APK
                if not exist apk md apk
                set APK_FILE=apk/FlashClientMobile.apk

                 

                echo APK_FILE: %APK_FILE%

                 

                :: Input
                set APP_XML=FlashClientMobile-app.xml
                set FILE_OR_DIR=FlashClientMobile.swf assets

                 

                echo APP_XML: %APP_XML%
                echo FILE_OR_DIR: %FILE_OR_DIR%

                 

                :: MEecho Signing AIR setup using certificate %CERTIFICATE%.
                echo AIR COMMAND adt -package %SIGNING_OPTIONS% %AIR_FILE% %APP_XML% %FILE_OR_DIR% 
                call adt -package %SIGNING_OPTIONS% %AIR_FILE% %APP_XML% %FILE_OR_DIR%
                if errorlevel 1 goto failed

                 

                :: echo.
                :: echo AIR setup created: %AIR_FILE%
                :: echo.

                 

                echo Signing APK setup using certificate %CERTIFICATE%.
                call adt -package -target apk %SIGNING_OPTIONS% %APK_FILE% %APP_XML% %FILE_OR_DIR%
                if errorlevel 1 goto failed2

                 

                echo.
                echo APK setup created: %APK_FILE%
                echo.

                 

                :: APK INSTALL
                echo Installing package... %APK_FILE%
                call adb install %APK_FILE%
                if errorlevel 1 goto failed2

                 

                echo.
                echo Android setup installed: %APK_FILE%
                echo.
                goto end

                 

                :certificate
                echo Certificate not found: %CERTIFICATE%
                echo.
                echo Troubleshotting:
                echo A certificate is required, generate one using 'CreateCertificate.bat'
                echo.
                goto end

                 

                :failed
                echo AIR setup creation FAILED.
                echo.
                echo Troubleshotting:
                echo did you configure the Flex SDK path in this Batch file?
                echo.

                 

                :failed2
                echo Android install FAILED.
                echo.

                 

                :end
                pause

                 

                //END BATCH FILE

                 

                I then did a diff between a Flex Buritto Moblie/AIR project library swc's included and identified swc included in AIR and missing in mobile. I updated the project libraries by adding the following swc's:

                 

                sparkskins.swc

                utilities.swc

                aircore.swc

                airframework.swc

                airspark.swc

                applicationupdater.swc

                applicationupdater_ui.swc

                 

                Then performed a clean build and ran packageApplication from my bin-debug dir and was successfully able to install and run the mobile application on the desktop :-).

                 

                Being new to supporting mobile phones, tablets, TV screens along with our web and desktop clients I am not yet sure how we will structure our projects and get maximum code reuse and UI consistancy across these form factors. I have already created a common library project containing all remote stubs, value objects and common utilities and am still trying to figure out how much mileage I can get out of my mobile views. I like the View Navigator and ActionBar navigation on all screens we support and am thinking to extend the ViewNavigator and add additional states along with the 'portrait' and 'landscape' currently offered, like 'portraitPhone', 'portraitTablet', 'portraitTV', 'portraitPC' and leverage my existing mobile views to use these states to adjust the UI layout to accomodate the new realestate... but still learning...

                 

                Hope that helps!

                 

                Cheers,


                Greg

                1 person found this helpful
                • 5. Re: Converting Burrito Flex Mobile App to Desktop
                  Richard Perrett Level 1

                  Greg,

                   

                  Thanks very much for taking the trouble to write up the solution.  I haven't had time to try it as I have been too busy recreating the app manually.  I don't mind too much doing this as I think the existing app renders to large on the screen. So I have been scaling this down as well.

                   

                  Have also just posted a problem concerning passing parameters from a spark list to a new view.  I think it must be easy as it is a very common requirement and is a piece of cake in flex mobile.  Grateful if you could take a look.

                   

                  Thanks again.

                   

                  Richard