SlideShare a Scribd company logo
1 of 37
BlackBerry 10 apps
with Adobe AIR & Apache Flex
JAM364
Mariano Carrizo
@kiwox – mariano@entiractive.com
5 – 6 February, 2013
About me
 BlackBerry Developer Elite
 BlackBerry Developer Group Argentina
    http://www.blackberrydev.com.ar
 iOS Developer Group Argentina
    http://iosdev.com.ar
 Adobe Community Professional
 Adobe Flex 4 & AIR Certified Expert
 Trainer
                                        For BlackBerry PlayBook


                                                                  2
About me




           3
Agenda
 Past and present of Adobe AIR
 Adobe AIR + BlackBerry 10
 Built for BlackBerry 10, deep integration APIs
 Extending with frameworks
 Tips & tricks
 Live examples
 Q&A




                                                  4
Adobe AIR
                                      Free and open source SDK
                                      Cross platfom for desktop, mobile and TV
                                      3.5 million developers
                                      ~70% online games built with Flash Platform
                                      Lot of frameworks and tools




                                                                                5
Stats source: http://www.adobe.com/products/player_census/flashplayer/
Adobe AIR features
  Local filesystem access
  Device sensors API
  SQLite
  Adobe Native Extensions (ANE)




                                  6
Adobe AIR: Filesystem


 var appBundle:File = File.applicationDirectory
 .resolvePath(“myFile.txt”);



 var shared:File = File.applicationStorageDirectory
 .resolvePath(“writeableFile.txt”);



 Note: This feature requires permission in bar-descriptor.xml
 <permission>access_shared</permission>                         7
Adobe AIR: GPS

  import flash.sensors.Geolocation;
  import flash.sensors.GeolocationEvent;
  ...
  protected function localizeMe():void {
     if (Geolocation.isSupported) {
         geo = new Geolocation();
         geo.setRequestedUpdateInterval(1);
         geo.addEventListener(GeolocationEvent.UPDATE,
     geolocationUpdateHandler);
     }
  }
                               Note: This feature requires permission in bar-descriptor.xml
                               <permission>read_geolocation</permission>                      8
Adobe AIR: CameraUI
if(CameraUI.isSupported) {
   var cam:CameraUI = new CameraUI();
   cam.addEventListener(MediaEvent.COMPLETE, onMediaComplete);
   cam.addEventListener(ErrorEvent.ERROR, cameraError);
   cam.launch(MediaType.IMAGE);
}




Note: This feature requires permission in bar-descriptor.xml
<permission>use_camera</permission>                            9
Adobe AIR: CameraUI
     if(CameraUI.isSupported) {
        var cam:CameraUI = new CameraUI();
        cam.addEventListener(MediaEvent.COMPLETE, onMediaComplete);
        cam.addEventListener(ErrorEvent.ERROR, cameraError);
        cam.launch(MediaType.IMAGE);
     } else {
        var ldr:Loader = new Loader();
        ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,
        imageLoadComplete);
        ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,
        ioErrorHandler);
        ldr.load(new URLRequest("static.png"));
     }

Note: This feature requires permission in bar-descriptor.xml
<permission>use_camera</permission>                                     10
Adobe AIR: CameraUI


protected function onMediaComplete(event:MediaEvent):void {
   if(event.data!=null) {
        var ldr:Loader = new Loader();
        ldr.loadFilePromise(event.data);
        ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,
   imageLoadComplete);
        ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,
   ioErrorHandler);
   }
}



                                                                   11
Adobe AIR: CameraUI



    protected function imageLoadComplete(event:Event):void {
       var ldr:Loader = event.target.loader as Loader;
       if(ldr!=null) {
            addChild(ldr);
       }
    }




                                                               12
Adobe AIR: CameraRoll


    protected function choosePicture():void {
            if(CameraRoll.supportsBrowseForImage) {
                    var roll:CameraRoll = new CameraRoll();
                    roll.addEventListener(MediaEvent.SELECT,
    onMediaComplete);
                    roll.browseForImage();
            }
    }




                                                               13
Built for BlackBerry 10
Platform SDK




                          14
Adobe AIR on BB10
 AIR Runtime 3.1 (more to come?)
 No cross-compiling required
 BlackBerry 10 SDK
    Fuse UI components
    Deep integration using ANEs
    Payment
    Push Notifications
    Invoke



                                   15
Adobe AIR on BB10



   var request:InvokeRequest = new InvokeRequest();
   request.target = "com.example.image.view";
   request.action = InvokeAction.OPEN;
   request.mimeType = "image/png";
   request.uri = "file:///path/to/image.png";
   InvokeManager.invokeManager.invoke( request );




                                                      16
Adobe AIR on BB10
var segment:SegmentedControl = new SegmentedControl();

segment.x = 10;
segment.y = 200;

var buttonArray:Array=[];
buttonArray.push({label:"Mon"});
buttonArray.push({label:"Tues"});
buttonArray.push({label:"Wed"});
buttonArray.push({label:"Thurs"});
buttonArray.push({label: "Fri”});

segment.dataProvider = new DataProvider(buttonArray);

segment.addEventListener(Event.CHANGE, segmentChanged);

addChild(mySegment);                                      17
Adobe AIR on BB10




                    18
Adobe AIR + BlackBerry 10
Live Demo #1




                            19
Adobe AIR + Frameworks
Making life easier




                         20
Frameworks and libraries
  User Interfaces      Charting
     Apache Flex         IBM Ilog Elixir
     PureMVC


  Games and Physics
                       Augmented Reality
     Box2D               FLAR Toolkit
     Nape                AR Toolkit (best performance with ANEs)


  3D engines           Maps
     Away3D              MapQuest
     Flare3D             Yahoo! maps
Apache Flex




              22
Apache Flex

NavigationBar




 TabBar



                23
Adobe AIR + BlackBerry 10 + Flex
Live Demo #2




                                   24
Tips & Tricks
Reaching a good application
Performance metrics
  Response time
     Screen load/appear
     Framerate (FPS)
  Memory
  Bundle size
Performance metrics

Effects, Scrolling, Transitions       Startup, Navigation, Data processing

              10%                                    16%
                                                               24%
     23%

                       67%

                                                     60%


  Rendering    ActionScript   Other
                                                                             27
Flex Performance
  BitmapImage
     GraphicElement
     Remote loading, scaling and Caching
     Supports multiple DPI based sources


  Spark Image
     Skinnable component
     Uses BitmapImage
     Progress, broken icon, chrome


                                            28
Flex Performance
                    Create and Render 1000 Instances

     BitmapImage



       MX Image                                                          Creation
                                                                         Validation
                                                                         Render
      Spark Image

                     0   500   1000   1500   2000   2500   3000   3500

                                      Time (ms)                                       29
Flex Performance
  Caching and Queuing
     ContentCache class
        Cache on by default
        Queue off by default
     contentLoader property on Spark Image, BitmapImage
     IContentLoader interface
  Use PNGs
  Avoid runtime scaling



                                                           30
Performance: Images


                      Bitmap




                      UIComponent
                      GraphicElements
                      FXG

                                    31
Performance: Images
                  Create and Render 1000 graphics

      Compiled FXG


    GraphicElements                                     Creation
                                                        Validation
     UIComponents                                       Render


                      0   200     400       600   800
                                Time (ms)
                                                                     32
Flex Performance: Text



    RichEditableText   RichText   Label   StyleableTextField



Poor performance                          Better performance




                                                               33
Flex Performance: ItemRenderers
   <s:ItemRenderer>
       <fx:Script>
           <![CDATA[
       import spark.core.ContentCache;
   static public const s_imageCache:ContentCache = new ContentCache();
               ]]>
       </fx:Script>

       <s:Hgroup>
           <s:BitmapImage id="icon" source="{data.graphic}"
                                    contentLoader="{s_imageCache}"/>
           <s:VGroup>
               <s:Label id="label"/>
           </s:Vgroup>
       </s:Hgroup>
   </s:ItemRenderer>                                                     34
Flex Performance: ItemRenderers
  Cache external content requests
  Beware text components
  Do not use filters / shadows
  LabelItemRenderer / IconItemRenderer




                                         35
Q&A
Time to answer




                 36
THANK YOU
JAM364
Mariano Carrizo
@kiwox – mariano@entiractive.com
5 – 6 February, 2013

More Related Content

What's hot

What's hot (12)

appengine ja night #24 Google Cloud Endpoints and BigQuery (English)
appengine ja night #24 Google Cloud Endpoints and BigQuery (English)appengine ja night #24 Google Cloud Endpoints and BigQuery (English)
appengine ja night #24 Google Cloud Endpoints and BigQuery (English)
 
PhoneGap: Accessing Device Capabilities
PhoneGap: Accessing Device CapabilitiesPhoneGap: Accessing Device Capabilities
PhoneGap: Accessing Device Capabilities
 
[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
 
What's new in android 4.4 - Romain Guy & Chet Haase
What's new in android 4.4 - Romain Guy & Chet HaaseWhat's new in android 4.4 - Romain Guy & Chet Haase
What's new in android 4.4 - Romain Guy & Chet Haase
 
The Glass Class - Tutorial 2 - Mirror API
The Glass Class - Tutorial 2 - Mirror APIThe Glass Class - Tutorial 2 - Mirror API
The Glass Class - Tutorial 2 - Mirror API
 
GOOGLE APP ENGINE Training in Chennai
GOOGLE APP ENGINE Training in ChennaiGOOGLE APP ENGINE Training in Chennai
GOOGLE APP ENGINE Training in Chennai
 
Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]
 
"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008
 
Exploring CameraX from JetPack
Exploring CameraX from JetPackExploring CameraX from JetPack
Exploring CameraX from JetPack
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
Automated Historical Performance Analysis with kmemtracer
Automated Historical Performance Analysis with kmemtracerAutomated Historical Performance Analysis with kmemtracer
Automated Historical Performance Analysis with kmemtracer
 

Similar to BlackBerry10 apps with Adobe AIR & Apache Flex - BlackBerry JAM Europe

Shape12 6
Shape12 6Shape12 6
Shape12 6
pslulli
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_final
NAVER D2
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
Benjamin Cabé
 

Similar to BlackBerry10 apps with Adobe AIR & Apache Flex - BlackBerry JAM Europe (20)

RICOH THETA x IoT Developers Contest : Cloud API Seminar
 RICOH THETA x IoT Developers Contest : Cloud API Seminar RICOH THETA x IoT Developers Contest : Cloud API Seminar
RICOH THETA x IoT Developers Contest : Cloud API Seminar
 
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esCreating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
 
HTML5 for Rich User Experience
HTML5 for Rich User ExperienceHTML5 for Rich User Experience
HTML5 for Rich User Experience
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile Web
 
Shape12 6
Shape12 6Shape12 6
Shape12 6
 
HTML5 WebWorks
HTML5 WebWorksHTML5 WebWorks
HTML5 WebWorks
 
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
 
Highload JavaScript Framework without Inheritance
Highload JavaScript Framework without InheritanceHighload JavaScript Framework without Inheritance
Highload JavaScript Framework without Inheritance
 
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
 
Adobe AIR 2.5 Beta for Android
Adobe AIR 2.5 Beta for AndroidAdobe AIR 2.5 Beta for Android
Adobe AIR 2.5 Beta for Android
 
air
airair
air
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_final
 
Abc2011 2 yagi
Abc2011 2 yagiAbc2011 2 yagi
Abc2011 2 yagi
 
Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
 
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
 
Deep Dive into SpaceONE
Deep Dive into SpaceONEDeep Dive into SpaceONE
Deep Dive into SpaceONE
 
426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools
 
Creating Flash Content for Multiple Screens
Creating Flash Content for Multiple ScreensCreating Flash Content for Multiple Screens
Creating Flash Content for Multiple Screens
 
Apache Cordova In Action
Apache Cordova In ActionApache Cordova In Action
Apache Cordova In Action
 

More from Mariano Carrizo

BlackBerry DevCon 2011 - COM34
BlackBerry DevCon 2011 - COM34BlackBerry DevCon 2011 - COM34
BlackBerry DevCon 2011 - COM34
Mariano Carrizo
 

More from Mariano Carrizo (15)

Energía Solar aplicada a sistemas HVAC
Energía Solar aplicada a sistemas HVACEnergía Solar aplicada a sistemas HVAC
Energía Solar aplicada a sistemas HVAC
 
Internet of Things - CIISI 2016
Internet of Things - CIISI 2016Internet of Things - CIISI 2016
Internet of Things - CIISI 2016
 
Experiencias Mobile - Social Media Day Córdoba
Experiencias Mobile - Social Media Day CórdobaExperiencias Mobile - Social Media Day Córdoba
Experiencias Mobile - Social Media Day Córdoba
 
Ecosistemas Mobile - eCommerce Day Argentina 2016
Ecosistemas Mobile - eCommerce Day Argentina 2016Ecosistemas Mobile - eCommerce Day Argentina 2016
Ecosistemas Mobile - eCommerce Day Argentina 2016
 
UX en interfaces conectadas (Internet of Things) - Adobe en Vivo 2014
UX en interfaces conectadas (Internet of Things) - Adobe en Vivo 2014UX en interfaces conectadas (Internet of Things) - Adobe en Vivo 2014
UX en interfaces conectadas (Internet of Things) - Adobe en Vivo 2014
 
Interfaces no convencionales para iOS, Android... y el resto - Adobe en Vivo ...
Interfaces no convencionales para iOS, Android... y el resto - Adobe en Vivo ...Interfaces no convencionales para iOS, Android... y el resto - Adobe en Vivo ...
Interfaces no convencionales para iOS, Android... y el resto - Adobe en Vivo ...
 
Presentación iOS 7 y OSX Mavericks - XVI meetup Desarrolladores iOS de Argentina
Presentación iOS 7 y OSX Mavericks - XVI meetup Desarrolladores iOS de ArgentinaPresentación iOS 7 y OSX Mavericks - XVI meetup Desarrolladores iOS de Argentina
Presentación iOS 7 y OSX Mavericks - XVI meetup Desarrolladores iOS de Argentina
 
Dispositivos móviles y la convergencia de medios, CIITI capítulo Rosario, 1/1...
Dispositivos móviles y la convergencia de medios, CIITI capítulo Rosario, 1/1...Dispositivos móviles y la convergencia de medios, CIITI capítulo Rosario, 1/1...
Dispositivos móviles y la convergencia de medios, CIITI capítulo Rosario, 1/1...
 
Publicaciones Digitales, un enfoque tecnológico
Publicaciones Digitales, un enfoque tecnológicoPublicaciones Digitales, un enfoque tecnológico
Publicaciones Digitales, un enfoque tecnológico
 
1º Jornadas tecnologicas en Rosario
1º Jornadas tecnologicas en Rosario1º Jornadas tecnologicas en Rosario
1º Jornadas tecnologicas en Rosario
 
Primer Hackaton del Desafío BlackBerry, Flex para móviles
Primer Hackaton del Desafío BlackBerry, Flex para móvilesPrimer Hackaton del Desafío BlackBerry, Flex para móviles
Primer Hackaton del Desafío BlackBerry, Flex para móviles
 
View controllers en iOS
View controllers en iOSView controllers en iOS
View controllers en iOS
 
BlackBerry DevCon 2011 - COM34
BlackBerry DevCon 2011 - COM34BlackBerry DevCon 2011 - COM34
BlackBerry DevCon 2011 - COM34
 
Adobe Flex 4.5 mobile y Adobe AIR 3 en ARFUG
Adobe Flex 4.5 mobile y Adobe AIR 3 en ARFUGAdobe Flex 4.5 mobile y Adobe AIR 3 en ARFUG
Adobe Flex 4.5 mobile y Adobe AIR 3 en ARFUG
 
BlueBox for BlackBerry PlayBook on AppCircus 2011
BlueBox for BlackBerry PlayBook on AppCircus 2011BlueBox for BlackBerry PlayBook on AppCircus 2011
BlueBox for BlackBerry PlayBook on AppCircus 2011
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

BlackBerry10 apps with Adobe AIR & Apache Flex - BlackBerry JAM Europe

  • 1. BlackBerry 10 apps with Adobe AIR & Apache Flex JAM364 Mariano Carrizo @kiwox – mariano@entiractive.com 5 – 6 February, 2013
  • 2. About me BlackBerry Developer Elite BlackBerry Developer Group Argentina  http://www.blackberrydev.com.ar iOS Developer Group Argentina  http://iosdev.com.ar Adobe Community Professional Adobe Flex 4 & AIR Certified Expert Trainer For BlackBerry PlayBook 2
  • 4. Agenda Past and present of Adobe AIR Adobe AIR + BlackBerry 10 Built for BlackBerry 10, deep integration APIs Extending with frameworks Tips & tricks Live examples Q&A 4
  • 5. Adobe AIR Free and open source SDK Cross platfom for desktop, mobile and TV 3.5 million developers ~70% online games built with Flash Platform Lot of frameworks and tools 5 Stats source: http://www.adobe.com/products/player_census/flashplayer/
  • 6. Adobe AIR features Local filesystem access Device sensors API SQLite Adobe Native Extensions (ANE) 6
  • 7. Adobe AIR: Filesystem var appBundle:File = File.applicationDirectory .resolvePath(“myFile.txt”); var shared:File = File.applicationStorageDirectory .resolvePath(“writeableFile.txt”); Note: This feature requires permission in bar-descriptor.xml <permission>access_shared</permission> 7
  • 8. Adobe AIR: GPS import flash.sensors.Geolocation; import flash.sensors.GeolocationEvent; ... protected function localizeMe():void { if (Geolocation.isSupported) { geo = new Geolocation(); geo.setRequestedUpdateInterval(1); geo.addEventListener(GeolocationEvent.UPDATE, geolocationUpdateHandler); } } Note: This feature requires permission in bar-descriptor.xml <permission>read_geolocation</permission> 8
  • 9. Adobe AIR: CameraUI if(CameraUI.isSupported) { var cam:CameraUI = new CameraUI(); cam.addEventListener(MediaEvent.COMPLETE, onMediaComplete); cam.addEventListener(ErrorEvent.ERROR, cameraError); cam.launch(MediaType.IMAGE); } Note: This feature requires permission in bar-descriptor.xml <permission>use_camera</permission> 9
  • 10. Adobe AIR: CameraUI if(CameraUI.isSupported) { var cam:CameraUI = new CameraUI(); cam.addEventListener(MediaEvent.COMPLETE, onMediaComplete); cam.addEventListener(ErrorEvent.ERROR, cameraError); cam.launch(MediaType.IMAGE); } else { var ldr:Loader = new Loader(); ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoadComplete); ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); ldr.load(new URLRequest("static.png")); } Note: This feature requires permission in bar-descriptor.xml <permission>use_camera</permission> 10
  • 11. Adobe AIR: CameraUI protected function onMediaComplete(event:MediaEvent):void { if(event.data!=null) { var ldr:Loader = new Loader(); ldr.loadFilePromise(event.data); ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoadComplete); ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); } } 11
  • 12. Adobe AIR: CameraUI protected function imageLoadComplete(event:Event):void { var ldr:Loader = event.target.loader as Loader; if(ldr!=null) { addChild(ldr); } } 12
  • 13. Adobe AIR: CameraRoll protected function choosePicture():void { if(CameraRoll.supportsBrowseForImage) { var roll:CameraRoll = new CameraRoll(); roll.addEventListener(MediaEvent.SELECT, onMediaComplete); roll.browseForImage(); } } 13
  • 14. Built for BlackBerry 10 Platform SDK 14
  • 15. Adobe AIR on BB10 AIR Runtime 3.1 (more to come?) No cross-compiling required BlackBerry 10 SDK  Fuse UI components  Deep integration using ANEs  Payment  Push Notifications  Invoke 15
  • 16. Adobe AIR on BB10 var request:InvokeRequest = new InvokeRequest(); request.target = "com.example.image.view"; request.action = InvokeAction.OPEN; request.mimeType = "image/png"; request.uri = "file:///path/to/image.png"; InvokeManager.invokeManager.invoke( request ); 16
  • 17. Adobe AIR on BB10 var segment:SegmentedControl = new SegmentedControl(); segment.x = 10; segment.y = 200; var buttonArray:Array=[]; buttonArray.push({label:"Mon"}); buttonArray.push({label:"Tues"}); buttonArray.push({label:"Wed"}); buttonArray.push({label:"Thurs"}); buttonArray.push({label: "Fri”}); segment.dataProvider = new DataProvider(buttonArray); segment.addEventListener(Event.CHANGE, segmentChanged); addChild(mySegment); 17
  • 18. Adobe AIR on BB10 18
  • 19. Adobe AIR + BlackBerry 10 Live Demo #1 19
  • 20. Adobe AIR + Frameworks Making life easier 20
  • 21. Frameworks and libraries User Interfaces Charting  Apache Flex  IBM Ilog Elixir  PureMVC Games and Physics Augmented Reality  Box2D  FLAR Toolkit  Nape  AR Toolkit (best performance with ANEs) 3D engines Maps  Away3D  MapQuest  Flare3D  Yahoo! maps
  • 24. Adobe AIR + BlackBerry 10 + Flex Live Demo #2 24
  • 25. Tips & Tricks Reaching a good application
  • 26. Performance metrics Response time  Screen load/appear  Framerate (FPS) Memory Bundle size
  • 27. Performance metrics Effects, Scrolling, Transitions Startup, Navigation, Data processing 10% 16% 24% 23% 67% 60% Rendering ActionScript Other 27
  • 28. Flex Performance BitmapImage  GraphicElement  Remote loading, scaling and Caching  Supports multiple DPI based sources Spark Image  Skinnable component  Uses BitmapImage  Progress, broken icon, chrome 28
  • 29. Flex Performance Create and Render 1000 Instances BitmapImage MX Image Creation Validation Render Spark Image 0 500 1000 1500 2000 2500 3000 3500 Time (ms) 29
  • 30. Flex Performance Caching and Queuing  ContentCache class Cache on by default Queue off by default  contentLoader property on Spark Image, BitmapImage  IContentLoader interface Use PNGs Avoid runtime scaling 30
  • 31. Performance: Images Bitmap UIComponent GraphicElements FXG 31
  • 32. Performance: Images Create and Render 1000 graphics Compiled FXG GraphicElements Creation Validation UIComponents Render 0 200 400 600 800 Time (ms) 32
  • 33. Flex Performance: Text RichEditableText RichText Label StyleableTextField Poor performance Better performance 33
  • 34. Flex Performance: ItemRenderers <s:ItemRenderer> <fx:Script> <![CDATA[ import spark.core.ContentCache; static public const s_imageCache:ContentCache = new ContentCache(); ]]> </fx:Script> <s:Hgroup> <s:BitmapImage id="icon" source="{data.graphic}" contentLoader="{s_imageCache}"/> <s:VGroup> <s:Label id="label"/> </s:Vgroup> </s:Hgroup> </s:ItemRenderer> 34
  • 35. Flex Performance: ItemRenderers Cache external content requests Beware text components Do not use filters / shadows LabelItemRenderer / IconItemRenderer 35
  • 37. THANK YOU JAM364 Mariano Carrizo @kiwox – mariano@entiractive.com 5 – 6 February, 2013