SlideShare a Scribd company logo
MAKING MOBILE FLEX APPS
BLAZING FAST
Michał Wróblewski
ABOUT


 @wrobel221
 Live in Poznań, Poland

 We make games in
  BlackMoon Design
 I come from Świebodzin
QUICK OUTLINE
 Quick  intro to Flex Mobile.
 A hard way from 5 FPS to 30+ FPS?

 Tricks’n’Tips

 The Robotlegs Way

 Q&A
SOMETHING ABOUT YOU
   How many of you got your hands dirty with mobile
    (especially Flex Mobile) development?
QUICK INTRO - VIEWNAVIGATORAPPLICATION



  You   can choose one of these:
   ViewNavigatorApplication
   TabbedViewNavigatorApplication

   SplitViewNavigatorApplication
    (coming with Flex 4.6)
QUICK INTRO - VIEWNAVIGATORAPPLICATION



 Contains an instance(s) of
  ViewNavigator(s).
 You setup some global properties of
  your app e.g, ActionBar content
QUICK INTRO - VIEWNAVIGATORAPPLICATION
QUICK INTRO - VIEWNAVIGATORAPPLICATION
QUICK INTRO - VIEWNAVIGATOR
 Manages moving between views.
 Has a stack of view data objects

 By default only one view exists, others are
  destroyed after remove (only data persists)
 Setup of default transitions

 Access to current view
QUICK INTRO - VIEWNAVIGATOR
   Navigation methods:
       replaceView,
       pushView,
       popView,
       popToFirstView,
       popAll
QUICK INTRO - VIEWNAVIGATOR
   Skin states:
       portrait,
       landscape,
       portraitAndOverlay,
       landscapeAndOverlay
QUICK INTRO - VIEW
 Visual container for a view of your mobile app.
 You should only add mobile-optimised Flex
  components here
 Accepts data passed in pushView

 Returns data by overriding createReturnObject()

 Has destructionPolicy (default – auto) to control
  whether the view should be destroyed on pop or
  just cached.
 Setup menu by placing ViewMenuItem in a
  <s:viewMenuItems> tag.
QUICK INTRO – COMMONS
 Label
 Icon

 actionContent

 navigationContent
OPTIMIZATION
OPTIMIZATION - BITMAPS
OPTIMIZATION - BITMAPS
   BitmapImage:
       Extends GraphicElement
       Remote loading
       Scaling
       Caching
OPTIMIZATION - BITMAPS
   Image (spark)
       Extends SkinnableComponent
       Has BitmapImage
       Supports progress
       Broken image icon
       Custom skinning
OPTIMIZATION - BITMAPS
 BitmapImage 3x faster than spark Image
 Try to avoid compressed image formats like JPG

 Do caching (on by default) and queuing (off by
  default) by using ContentCache. Assign it to
  contentLoader property of BitmapImage and Image
OPTIMIZATION - TEXT
 RichEditableText
 RichText

 Label

 StyleableTextField (new in Flex 4.5)

 StageText (coming in Flex 4.6)
OPTIMIZATION - TEXT
 Only StyleableTextField extends flash.text.TextField
 Can’t use StyleableTextField directly in MXML, so
  you’re quite pushed to use it in AS3.
OPTIMIZATION – LISTS AND ITEMRENDERERS
 All mentioned before apply
 uber-optimized LabelItemRenderer and
  IconItemRenderer
OPTIMIZATION – LISTS AND ITEMRENDERERS
 Mobile item renderers – if possible use bundler
  uber-optimized LabelItemRenderer and
  IconItemRenderer, they were shown in all Flex
  Mobile demos.
 Avoid complex binding expressions.
 Turn off autoDrawBackground if not needed.
 Use cacheAsBitmap, but be careful.
 Use opaqueBackground
 itemRendererFunction prevents pooling and
  recycling.
 Favor FXG over spark graphic elements (if
  possible)
OPTIMIZATION - SKINS
 Extend MobileSkin instead of SparkSkin
 AS3 version will perform better than MXML

 Use FXG for static vector graphics, use where
  possible
 Use GraphicElement as lightweight graphic
  primitives. E.g. Backgrounds, borders etc.
TRICKS’N’TIPS
 Adding    platform specific UI patterns
     CSS media rules
     Separate projects with common code base
     Ready multiplatform mobile themes
TRICKS’N’TIPS
 Handlingmulti DPI devices with
 MultiDPIBitmapSource
TRICKS’N’TIPS
 Be sure not to put references to view
 instances anywhere.
TRICKS’N’TIPS
 Don’t interfere expensive process of parsing
  data into view when doing a transition.
 Use BusyIndicator before or after transition.
TRICKS’N’TIPS
 Don’t
      cheat by testing your app on a high-end
 smartphone
TRICKS’N’TIPS
 Please   don’t use filters.
TRICKS’N’TIPS
 Have   memory usage and limitations in mind
TRICKS’N’TIPS
 On  every level make your display list as flat
  as possible.
 Use Shaun’s script to show more info about
  the display list tree
TRICKS’N’TIPS
 At   the end:
 [profile, test, optimize].loop()
THE ROBOTLEGS WAY
THE ROBOTLEGS WAY
   “I and my team have been using Robotlegs to build
    several apps for many months, and I've never had
    any issues caused by Robotlegs”
                                  Paul Robertson
THE ROBOTLEGS WAY
 Views are being destroyed when you push a new
  view.
 The same will happen with Mediators
THE ROBOTLEGS WAY
   You’ll need an instance of ViewNavigator in your
    navigator manager.
THE ROBOTLEGS WAY
 Don’t hesitate to use viewManager in your View.
 Dispatch a command only if you need some data
  from the rest of the application.
THE ROBOTLEGS WAY
A QUESTION TO YOU
 Howdo you approach multiscreen
 development?
THANKS!
 Any   questions?

More Related Content

Similar to Making mobile flex apps blazing fast

Introduction to Flex Hero for Mobile Devices
Introduction to Flex Hero for Mobile DevicesIntroduction to Flex Hero for Mobile Devices
Introduction to Flex Hero for Mobile Devices
Ryan Stewart
 
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Paris Android User Group
 
Assignment 4 Paparazzi1
Assignment 4 Paparazzi1Assignment 4 Paparazzi1
Assignment 4 Paparazzi1
Mahmoud
 
Android Development with Flash Builder Burrito
Android Development with Flash Builder BurritoAndroid Development with Flash Builder Burrito
Android Development with Flash Builder Burrito
Jeff Bollinger
 
Angular js mobile jsday 2014 - Verona 14 may
Angular js mobile   jsday 2014 - Verona 14 mayAngular js mobile   jsday 2014 - Verona 14 may
Angular js mobile jsday 2014 - Verona 14 may
Luciano Amodio
 
An end-to-end experience of Windows Phone 7 development (Part 1)
An end-to-end experience of Windows Phone 7 development (Part 1)An end-to-end experience of Windows Phone 7 development (Part 1)
An end-to-end experience of Windows Phone 7 development (Part 1)
rudigrobler
 
Building a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one weekBuilding a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one week
Dr. Felix Raab
 
Postmortem of a uwp xaml application development
Postmortem of a uwp xaml application developmentPostmortem of a uwp xaml application development
Postmortem of a uwp xaml application development
David Catuhe
 
04 objective-c session 4
04  objective-c session 404  objective-c session 4
04 objective-c session 4
Amr Elghadban (AmrAngry)
 
Flash Builder and Flex Future - Multiscreen Development
Flash Builder and Flex Future - Multiscreen DevelopmentFlash Builder and Flex Future - Multiscreen Development
Flash Builder and Flex Future - Multiscreen Development
Ryan Stewart
 
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
DicodingEvent
 
Twitter trends
Twitter trendsTwitter trends
Silverlight overview
Silverlight overviewSilverlight overview
Silverlight overview
Taras Romanyk
 
iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1
Hussain Behestee
 
AD503: XPages Mobile Development in IBM Domino 9.0.1 and Beyond
AD503: XPages Mobile Development in IBM Domino 9.0.1 and BeyondAD503: XPages Mobile Development in IBM Domino 9.0.1 and Beyond
AD503: XPages Mobile Development in IBM Domino 9.0.1 and Beyond
Tony McGuckin
 
Open sap ui5 - week_2 unit_1_syjewa_exercises
Open sap ui5  - week_2 unit_1_syjewa_exercisesOpen sap ui5  - week_2 unit_1_syjewa_exercises
Open sap ui5 - week_2 unit_1_syjewa_exercises
Borusan Birlik Danışmanlık
 
Progressive Web Application by Citytech
Progressive Web Application by CitytechProgressive Web Application by Citytech
Progressive Web Application by Citytech
Ritwik Das
 
Google Associate Android Developer Certification
Google Associate Android Developer CertificationGoogle Associate Android Developer Certification
Google Associate Android Developer Certification
Monir Zzaman
 
Top Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on TabletsTop Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on Tablets
Motorola Mobility - MOTODEV
 
Development With eRCP
Development With eRCPDevelopment With eRCP
Development With eRCP
Gorkem Ercan
 

Similar to Making mobile flex apps blazing fast (20)

Introduction to Flex Hero for Mobile Devices
Introduction to Flex Hero for Mobile DevicesIntroduction to Flex Hero for Mobile Devices
Introduction to Flex Hero for Mobile Devices
 
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
 
Assignment 4 Paparazzi1
Assignment 4 Paparazzi1Assignment 4 Paparazzi1
Assignment 4 Paparazzi1
 
Android Development with Flash Builder Burrito
Android Development with Flash Builder BurritoAndroid Development with Flash Builder Burrito
Android Development with Flash Builder Burrito
 
Angular js mobile jsday 2014 - Verona 14 may
Angular js mobile   jsday 2014 - Verona 14 mayAngular js mobile   jsday 2014 - Verona 14 may
Angular js mobile jsday 2014 - Verona 14 may
 
An end-to-end experience of Windows Phone 7 development (Part 1)
An end-to-end experience of Windows Phone 7 development (Part 1)An end-to-end experience of Windows Phone 7 development (Part 1)
An end-to-end experience of Windows Phone 7 development (Part 1)
 
Building a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one weekBuilding a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one week
 
Postmortem of a uwp xaml application development
Postmortem of a uwp xaml application developmentPostmortem of a uwp xaml application development
Postmortem of a uwp xaml application development
 
04 objective-c session 4
04  objective-c session 404  objective-c session 4
04 objective-c session 4
 
Flash Builder and Flex Future - Multiscreen Development
Flash Builder and Flex Future - Multiscreen DevelopmentFlash Builder and Flex Future - Multiscreen Development
Flash Builder and Flex Future - Multiscreen Development
 
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
 
Twitter trends
Twitter trendsTwitter trends
Twitter trends
 
Silverlight overview
Silverlight overviewSilverlight overview
Silverlight overview
 
iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1
 
AD503: XPages Mobile Development in IBM Domino 9.0.1 and Beyond
AD503: XPages Mobile Development in IBM Domino 9.0.1 and BeyondAD503: XPages Mobile Development in IBM Domino 9.0.1 and Beyond
AD503: XPages Mobile Development in IBM Domino 9.0.1 and Beyond
 
Open sap ui5 - week_2 unit_1_syjewa_exercises
Open sap ui5  - week_2 unit_1_syjewa_exercisesOpen sap ui5  - week_2 unit_1_syjewa_exercises
Open sap ui5 - week_2 unit_1_syjewa_exercises
 
Progressive Web Application by Citytech
Progressive Web Application by CitytechProgressive Web Application by Citytech
Progressive Web Application by Citytech
 
Google Associate Android Developer Certification
Google Associate Android Developer CertificationGoogle Associate Android Developer Certification
Google Associate Android Developer Certification
 
Top Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on TabletsTop Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on Tablets
 
Development With eRCP
Development With eRCPDevelopment With eRCP
Development With eRCP
 

Recently uploaded

Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 

Recently uploaded (20)

Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 

Making mobile flex apps blazing fast

  • 1. MAKING MOBILE FLEX APPS BLAZING FAST Michał Wróblewski
  • 2. ABOUT  @wrobel221  Live in Poznań, Poland  We make games in BlackMoon Design  I come from Świebodzin
  • 3. QUICK OUTLINE  Quick intro to Flex Mobile.  A hard way from 5 FPS to 30+ FPS?  Tricks’n’Tips  The Robotlegs Way  Q&A
  • 4. SOMETHING ABOUT YOU  How many of you got your hands dirty with mobile (especially Flex Mobile) development?
  • 5. QUICK INTRO - VIEWNAVIGATORAPPLICATION  You can choose one of these: ViewNavigatorApplication TabbedViewNavigatorApplication SplitViewNavigatorApplication (coming with Flex 4.6)
  • 6. QUICK INTRO - VIEWNAVIGATORAPPLICATION  Contains an instance(s) of ViewNavigator(s).  You setup some global properties of your app e.g, ActionBar content
  • 7. QUICK INTRO - VIEWNAVIGATORAPPLICATION
  • 8. QUICK INTRO - VIEWNAVIGATORAPPLICATION
  • 9. QUICK INTRO - VIEWNAVIGATOR  Manages moving between views.  Has a stack of view data objects  By default only one view exists, others are destroyed after remove (only data persists)  Setup of default transitions  Access to current view
  • 10. QUICK INTRO - VIEWNAVIGATOR  Navigation methods:  replaceView,  pushView,  popView,  popToFirstView,  popAll
  • 11. QUICK INTRO - VIEWNAVIGATOR  Skin states:  portrait,  landscape,  portraitAndOverlay,  landscapeAndOverlay
  • 12. QUICK INTRO - VIEW  Visual container for a view of your mobile app.  You should only add mobile-optimised Flex components here  Accepts data passed in pushView  Returns data by overriding createReturnObject()  Has destructionPolicy (default – auto) to control whether the view should be destroyed on pop or just cached.  Setup menu by placing ViewMenuItem in a <s:viewMenuItems> tag.
  • 13. QUICK INTRO – COMMONS  Label  Icon  actionContent  navigationContent
  • 16. OPTIMIZATION - BITMAPS  BitmapImage:  Extends GraphicElement  Remote loading  Scaling  Caching
  • 17. OPTIMIZATION - BITMAPS  Image (spark)  Extends SkinnableComponent  Has BitmapImage  Supports progress  Broken image icon  Custom skinning
  • 18. OPTIMIZATION - BITMAPS  BitmapImage 3x faster than spark Image  Try to avoid compressed image formats like JPG  Do caching (on by default) and queuing (off by default) by using ContentCache. Assign it to contentLoader property of BitmapImage and Image
  • 19. OPTIMIZATION - TEXT  RichEditableText  RichText  Label  StyleableTextField (new in Flex 4.5)  StageText (coming in Flex 4.6)
  • 20. OPTIMIZATION - TEXT  Only StyleableTextField extends flash.text.TextField  Can’t use StyleableTextField directly in MXML, so you’re quite pushed to use it in AS3.
  • 21. OPTIMIZATION – LISTS AND ITEMRENDERERS  All mentioned before apply  uber-optimized LabelItemRenderer and IconItemRenderer
  • 22. OPTIMIZATION – LISTS AND ITEMRENDERERS  Mobile item renderers – if possible use bundler uber-optimized LabelItemRenderer and IconItemRenderer, they were shown in all Flex Mobile demos.  Avoid complex binding expressions.  Turn off autoDrawBackground if not needed.  Use cacheAsBitmap, but be careful.  Use opaqueBackground  itemRendererFunction prevents pooling and recycling.  Favor FXG over spark graphic elements (if possible)
  • 23. OPTIMIZATION - SKINS  Extend MobileSkin instead of SparkSkin  AS3 version will perform better than MXML  Use FXG for static vector graphics, use where possible  Use GraphicElement as lightweight graphic primitives. E.g. Backgrounds, borders etc.
  • 24. TRICKS’N’TIPS  Adding platform specific UI patterns  CSS media rules  Separate projects with common code base  Ready multiplatform mobile themes
  • 25. TRICKS’N’TIPS  Handlingmulti DPI devices with MultiDPIBitmapSource
  • 26. TRICKS’N’TIPS  Be sure not to put references to view instances anywhere.
  • 27. TRICKS’N’TIPS  Don’t interfere expensive process of parsing data into view when doing a transition.  Use BusyIndicator before or after transition.
  • 28. TRICKS’N’TIPS  Don’t cheat by testing your app on a high-end smartphone
  • 29. TRICKS’N’TIPS  Please don’t use filters.
  • 30. TRICKS’N’TIPS  Have memory usage and limitations in mind
  • 31. TRICKS’N’TIPS  On every level make your display list as flat as possible.  Use Shaun’s script to show more info about the display list tree
  • 32. TRICKS’N’TIPS  At the end: [profile, test, optimize].loop()
  • 34. THE ROBOTLEGS WAY  “I and my team have been using Robotlegs to build several apps for many months, and I've never had any issues caused by Robotlegs” Paul Robertson
  • 35. THE ROBOTLEGS WAY  Views are being destroyed when you push a new view.  The same will happen with Mediators
  • 36. THE ROBOTLEGS WAY  You’ll need an instance of ViewNavigator in your navigator manager.
  • 37. THE ROBOTLEGS WAY  Don’t hesitate to use viewManager in your View.  Dispatch a command only if you need some data from the rest of the application.
  • 39. A QUESTION TO YOU  Howdo you approach multiscreen development?
  • 40. THANKS!  Any questions?