SlideShare a Scribd company logo
1 of 38
Download to read offline
Introduction to
 Introduction to
Flash Runtime Mobile Features
Flash Runtime Mobile Features          White Master




Flash Runtime Globalization Team
Flash Runtime Globalization Team
Hao Wu, Yi Zhai
                                   1
1. Features of Flash Runtime on Mobile
   Accelerometer

   GPS

   Camera

   Stage Video

   Device Speaker Control

2. Workshop – Native Extension




                             2
3
   The Accelerometer class dispatches events based on activity detected by the
    device's motion sensor. This data represents the device's location or
    movement along a 3-dimensional axis.




                                         4
var accelerometer:Accelerometer;
if(Accelerometer.isSupported){
    accelerometer = new Accelerometer();
    accelerometer.addEventListener(AccelerometerEvent.UPDATE,
                                                          updateHandler);
}
private function updateHandler (e:AccelerometerEvent):void{
    trace(e.accelerationX);
    trace(e.accelerationY);
    trace(e.accelerationZ);
    trace(e.timestamp)
}




                                      5
6
7
   The Geolocation class dispatches events in response to the device's location
    sensor.




                                          8
var geolocation:Geolocation;
if(Geolocation.isSupported){
    geolocation = new Geolocation();
    if(!geolocation.muted){
              geolocation.setRequestedUpdateInterval(10000);
              geolocation.addEventListener(GeolocationEvent.UPDATE,updateHandler);
    }
}
private function updateHandler(e:GeolocationEvent):void{
    trace(e.longitude);
    trace(e.latitude);
    trace(e.altitude); //Other properties: heading, speed, timestamp
}                             //horizaontalAccuracy, VerticalAccuracy,




                                               9
10
11
   CameraUI
        The CameraUI class allows you to capture a still image or video using the
         default camera application on a device.
   CameraRoll
        The CameraRoll class allows you to access image data in the system media
         library or "camera roll."




                                           12
if (CameraUI.isSupported){
    myCam = new CameraUI();
    myCam.addEventListener(MediaEvent.COMPLETE, onComplete);
    myCam.launch(MediaType.IMAGE);
}


if (CameraRoll.supportsBrowseForImage){
    roll = new CameraRoll();
    roll.addEventListener(MediaEvent.SELECT,onMediaSelect);
    roll.browseForImage();
}




                                     13
14
15
16
   The StageVideo object uses the device's hardware acceleration capabilities, if
    available, to display live or recorded video in an application. Hardware
    acceleration capabilities are available on most devices




                                          17
VideoStatus.ACCELERATER   VideoStatus.SOFTWARE

             最佳性能
StageVideo                             使用软件解码,用GPU合成
             使用GPU解码并合成


                                       最差的情况
Video        使用硬件GPU解码,软件合成
                                       使用软件解码并合成




                                 18
private static const FILE_NAME:String = "media/Test_original.mp4";
var sv:StageVideo;
var nc:NetConnection;
var ns:NetStream;
nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY,
                                       onStageVideoState);




                                       19
private function onStageVideoState(event:StageVideoAvailabilityEvent):void{


    // Detect if StageVideo is available and decide what to do in toggleStageVideo
    toggleStageVideo(available = inited = (event.availability ==
                                     StageVideoAvailability.AVAILABLE));
}
private function toggleStageVideo(on:Boolean):void{
    sv = stage.stageVideos[0];
    sv.attachNetStream(ns);
    ns.play(FILE_NAME);
}




                                       20
21
22
Ear Piece
                 Speaker Phone




            23
Feature summary
    Enable mobile app to toggle between earpiece and speakerphone
             AIR 2.7                                  > AIR 3.0
No way to choose two speaks         Easily access different speakers
All audio play back through media   Enable the VOIP telephony
speaker
                                    Enumerate all the speakers attached to
                                    device on mobile and desktop

Use cases
    New Adobe Directory/Connect for Android, with VoIP feature
    More AIR-based enterprise apps, integrating Flash Media Gateway



                                      24
AudioPlaybackMode   Speakerphone in       iOS Category be        Audio Output Route
                    use                   used                   (Headphone)
Media               0                     MediaPlayback          Device Speaker
                                                                 (Headphone)
Media               1                     MediaPlayback          Device Speaker
                                                                 (Headphone)




AudioPlaybackMode   Speakerphone in use   iOS Category be used    Audio Output Route
                                                                  (Headphone)
Voice               0                     PlayAndRecord           Phone Receiver
                                                                  (Headphone)
Voice               1                     PlayAndRecord           Device Speaker




                                          25
Play_button.addEventListener(MouseEvent.CLICK, playMusic);
function playMusic(e:Event):void
{
    SoundMixer.audioPlaybackMode = “media”;
    SoundMixer.useSpeakerphoneForVoice = false;
    if(! playing)
    {
             sc = music.play(pos);
             playing = true;
    }
}




                                     26
 Microphone.isSupported
 Microphone.getMicrophone()
 Microphone.getEnhancedMicrophone()
 Microphone.setUseEchoSuppression()
 Microphone.setSilenceLevel(silenceLevel,   timeout)
 SampleDataEvent.SAMPLE_DATA
 Microphone.activityLevel




                                       27
…

   Front-facing camera support
   Android Market licensing integration
   Captive runtime support for Android
   Stagetext
   Flash Access on Android
   Mobile background app audio playback for iOS
   Enable HW Video decoding on various chipsets
   Native Extensions on Mobile




                                      28
NativeExtension




       29
The native extensions feature enables the addition of third-party, native-code
backed ActionScript APIs to AIR applications.




         Normal apps                           NativeExtension apps

           A actionscript Library with Native Code implementation


                                         30
   Enhance Performance
        Zxing:ActionScript 2000ms, Android 10ms
   Expand functions
        Autofocus for camera , Vibration …




                                          31
32
33
34
35
An Android Project

    Provide Native Implementation for Native Extension

A Flex Library Project

    Provide ActionScript API for Native Extension




                                        36
Ane file

    A set of Actionscript with native code implementation

A Flex Mobile Project

    Use the ane




                                       37
38

More Related Content

What's hot

android_project
android_projectandroid_project
android_projectAdit Ghosh
 
Ableton Live 8 Manual En
Ableton Live 8 Manual EnAbleton Live 8 Manual En
Ableton Live 8 Manual Enguestcd5313
 
Development Playbook Application With Adobe AIR 2.5 and QNX SDK
Development Playbook Application With Adobe AIR 2.5 and QNX SDKDevelopment Playbook Application With Adobe AIR 2.5 and QNX SDK
Development Playbook Application With Adobe AIR 2.5 and QNX SDKTubagus Anwar
 
Autonomous Drone Development with Java and IoT
Autonomous Drone Development with Java and IoTAutonomous Drone Development with Java and IoT
Autonomous Drone Development with Java and IoTjavafxpert
 
Droidcon 2011: Gingerbread and honeycomb, Markus Junginger, Greenrobot
Droidcon 2011: Gingerbread and honeycomb, Markus Junginger,  GreenrobotDroidcon 2011: Gingerbread and honeycomb, Markus Junginger,  Greenrobot
Droidcon 2011: Gingerbread and honeycomb, Markus Junginger, GreenrobotDroidcon Berlin
 
[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...
[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...
[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...BeMyApp
 
[Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TV
[Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TV[Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TV
[Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TVBeMyApp
 
I/O 2011 報告会 ADKで遊んでみた
I/O 2011 報告会 ADKで遊んでみたI/O 2011 報告会 ADKで遊んでみた
I/O 2011 報告会 ADKで遊んでみたMakoto Yamazaki
 

What's hot (9)

android_project
android_projectandroid_project
android_project
 
Ableton Live 8 Manual En
Ableton Live 8 Manual EnAbleton Live 8 Manual En
Ableton Live 8 Manual En
 
Development Playbook Application With Adobe AIR 2.5 and QNX SDK
Development Playbook Application With Adobe AIR 2.5 and QNX SDKDevelopment Playbook Application With Adobe AIR 2.5 and QNX SDK
Development Playbook Application With Adobe AIR 2.5 and QNX SDK
 
Autonomous Drone Development with Java and IoT
Autonomous Drone Development with Java and IoTAutonomous Drone Development with Java and IoT
Autonomous Drone Development with Java and IoT
 
Droidcon 2011: Gingerbread and honeycomb, Markus Junginger, Greenrobot
Droidcon 2011: Gingerbread and honeycomb, Markus Junginger,  GreenrobotDroidcon 2011: Gingerbread and honeycomb, Markus Junginger,  Greenrobot
Droidcon 2011: Gingerbread and honeycomb, Markus Junginger, Greenrobot
 
[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...
[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...
[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...
 
[Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TV
[Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TV[Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TV
[Ultracode Munich Meetup #7] Building Apps for Nexus Player & Android TV
 
Usability lab design proposal
Usability lab design proposal Usability lab design proposal
Usability lab design proposal
 
I/O 2011 報告会 ADKで遊んでみた
I/O 2011 報告会 ADKで遊んでみたI/O 2011 報告会 ADKで遊んでみた
I/O 2011 報告会 ADKで遊んでみた
 

Similar to Flash runtime on mobile

Creating Flash Content for Multiple Screens
Creating Flash Content for Multiple ScreensCreating Flash Content for Multiple Screens
Creating Flash Content for Multiple Screenspaultrani
 
Flash for Mobile Devices
Flash for Mobile DevicesFlash for Mobile Devices
Flash for Mobile Devicespaultrani
 
AIR2.5 Hands On - Flash on the Beach 2010
AIR2.5 Hands On - Flash on the Beach 2010AIR2.5 Hands On - Flash on the Beach 2010
AIR2.5 Hands On - Flash on the Beach 2010Mark Doherty
 
Flash and Hardware
Flash and HardwareFlash and Hardware
Flash and HardwareKevin Hoyt
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindiappsdevelopment
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorialSynapseindiappsdevelopment
 
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 AndroidMark Doherty
 
Android Open Accessory APIs
Android Open Accessory APIsAndroid Open Accessory APIs
Android Open Accessory APIsPearl Chen
 
WebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla LondonWebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla LondonRobert Nyman
 
Building Android games using LibGDX
Building Android games using LibGDXBuilding Android games using LibGDX
Building Android games using LibGDXJussi Pohjolainen
 
Intro to Building Android Games using libGDX
Intro to Building Android Games using libGDXIntro to Building Android Games using libGDX
Intro to Building Android Games using libGDXJussi Pohjolainen
 
Becoming a kinect hacker innovator v2
Becoming a kinect hacker innovator v2Becoming a kinect hacker innovator v2
Becoming a kinect hacker innovator v2Jeff Sipko
 
What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018Somkiat Khitwongwattana
 
Human Interaction Library
Human Interaction LibraryHuman Interaction Library
Human Interaction Librarygraphitech
 
I phone app develoment ppt
I phone app develoment   pptI phone app develoment   ppt
I phone app develoment pptsagaroceanic11
 
I phone app develoment ppt
I phone app develoment   pptI phone app develoment   ppt
I phone app develoment pptsagaroceanic11
 
Silverlight in Internet Scenarios
Silverlight in Internet ScenariosSilverlight in Internet Scenarios
Silverlight in Internet ScenariosRicardo Fiel
 

Similar to Flash runtime on mobile (20)

Creating Flash Content for Multiple Screens
Creating Flash Content for Multiple ScreensCreating Flash Content for Multiple Screens
Creating Flash Content for Multiple Screens
 
Flash for Mobile Devices
Flash for Mobile DevicesFlash for Mobile Devices
Flash for Mobile Devices
 
AIR2.5 Hands On - Flash on the Beach 2010
AIR2.5 Hands On - Flash on the Beach 2010AIR2.5 Hands On - Flash on the Beach 2010
AIR2.5 Hands On - Flash on the Beach 2010
 
Flash and Hardware
Flash and HardwareFlash and Hardware
Flash and Hardware
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorial
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorial
 
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
 
Android Open Accessory APIs
Android Open Accessory APIsAndroid Open Accessory APIs
Android Open Accessory APIs
 
WebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla LondonWebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla London
 
Andriod Pentesting and Malware Analysis
Andriod Pentesting and Malware AnalysisAndriod Pentesting and Malware Analysis
Andriod Pentesting and Malware Analysis
 
Building Android games using LibGDX
Building Android games using LibGDXBuilding Android games using LibGDX
Building Android games using LibGDX
 
Intro to Building Android Games using libGDX
Intro to Building Android Games using libGDXIntro to Building Android Games using libGDX
Intro to Building Android Games using libGDX
 
Integrando sua app Android com Chromecast
Integrando sua app Android com ChromecastIntegrando sua app Android com Chromecast
Integrando sua app Android com Chromecast
 
Becoming a kinect hacker innovator v2
Becoming a kinect hacker innovator v2Becoming a kinect hacker innovator v2
Becoming a kinect hacker innovator v2
 
What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018
 
Human Interaction Library
Human Interaction LibraryHuman Interaction Library
Human Interaction Library
 
I phone app develoment ppt
I phone app develoment   pptI phone app develoment   ppt
I phone app develoment ppt
 
I phone app develoment ppt
I phone app develoment   pptI phone app develoment   ppt
I phone app develoment ppt
 
Java-Events
Java-EventsJava-Events
Java-Events
 
Silverlight in Internet Scenarios
Silverlight in Internet ScenariosSilverlight in Internet Scenarios
Silverlight in Internet Scenarios
 

Recently uploaded

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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 Scriptwesley chun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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.pptxEarley Information Science
 
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 WorkerThousandEyes
 
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...Igalia
 
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 AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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 productivityPrincipled Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Recently uploaded (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
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
 
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
 
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...
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Flash runtime on mobile

  • 1. Introduction to Introduction to Flash Runtime Mobile Features Flash Runtime Mobile Features White Master Flash Runtime Globalization Team Flash Runtime Globalization Team Hao Wu, Yi Zhai 1
  • 2. 1. Features of Flash Runtime on Mobile  Accelerometer  GPS  Camera  Stage Video  Device Speaker Control 2. Workshop – Native Extension 2
  • 3. 3
  • 4. The Accelerometer class dispatches events based on activity detected by the device's motion sensor. This data represents the device's location or movement along a 3-dimensional axis. 4
  • 5. var accelerometer:Accelerometer; if(Accelerometer.isSupported){ accelerometer = new Accelerometer(); accelerometer.addEventListener(AccelerometerEvent.UPDATE, updateHandler); } private function updateHandler (e:AccelerometerEvent):void{ trace(e.accelerationX); trace(e.accelerationY); trace(e.accelerationZ); trace(e.timestamp) } 5
  • 6. 6
  • 7. 7
  • 8. The Geolocation class dispatches events in response to the device's location sensor. 8
  • 9. var geolocation:Geolocation; if(Geolocation.isSupported){ geolocation = new Geolocation(); if(!geolocation.muted){ geolocation.setRequestedUpdateInterval(10000); geolocation.addEventListener(GeolocationEvent.UPDATE,updateHandler); } } private function updateHandler(e:GeolocationEvent):void{ trace(e.longitude); trace(e.latitude); trace(e.altitude); //Other properties: heading, speed, timestamp } //horizaontalAccuracy, VerticalAccuracy, 9
  • 10. 10
  • 11. 11
  • 12. CameraUI  The CameraUI class allows you to capture a still image or video using the default camera application on a device.  CameraRoll  The CameraRoll class allows you to access image data in the system media library or "camera roll." 12
  • 13. if (CameraUI.isSupported){ myCam = new CameraUI(); myCam.addEventListener(MediaEvent.COMPLETE, onComplete); myCam.launch(MediaType.IMAGE); } if (CameraRoll.supportsBrowseForImage){ roll = new CameraRoll(); roll.addEventListener(MediaEvent.SELECT,onMediaSelect); roll.browseForImage(); } 13
  • 14. 14
  • 15. 15
  • 16. 16
  • 17. The StageVideo object uses the device's hardware acceleration capabilities, if available, to display live or recorded video in an application. Hardware acceleration capabilities are available on most devices 17
  • 18. VideoStatus.ACCELERATER VideoStatus.SOFTWARE 最佳性能 StageVideo 使用软件解码,用GPU合成 使用GPU解码并合成 最差的情况 Video 使用硬件GPU解码,软件合成 使用软件解码并合成 18
  • 19. private static const FILE_NAME:String = "media/Test_original.mp4"; var sv:StageVideo; var nc:NetConnection; var ns:NetStream; nc = new NetConnection(); nc.connect(null); ns = new NetStream(nc); stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoState); 19
  • 20. private function onStageVideoState(event:StageVideoAvailabilityEvent):void{ // Detect if StageVideo is available and decide what to do in toggleStageVideo toggleStageVideo(available = inited = (event.availability == StageVideoAvailability.AVAILABLE)); } private function toggleStageVideo(on:Boolean):void{ sv = stage.stageVideos[0]; sv.attachNetStream(ns); ns.play(FILE_NAME); } 20
  • 21. 21
  • 22. 22
  • 23. Ear Piece Speaker Phone 23
  • 24. Feature summary  Enable mobile app to toggle between earpiece and speakerphone AIR 2.7 > AIR 3.0 No way to choose two speaks Easily access different speakers All audio play back through media Enable the VOIP telephony speaker Enumerate all the speakers attached to device on mobile and desktop Use cases  New Adobe Directory/Connect for Android, with VoIP feature  More AIR-based enterprise apps, integrating Flash Media Gateway 24
  • 25. AudioPlaybackMode Speakerphone in iOS Category be Audio Output Route use used (Headphone) Media 0 MediaPlayback Device Speaker (Headphone) Media 1 MediaPlayback Device Speaker (Headphone) AudioPlaybackMode Speakerphone in use iOS Category be used Audio Output Route (Headphone) Voice 0 PlayAndRecord Phone Receiver (Headphone) Voice 1 PlayAndRecord Device Speaker 25
  • 26. Play_button.addEventListener(MouseEvent.CLICK, playMusic); function playMusic(e:Event):void { SoundMixer.audioPlaybackMode = “media”; SoundMixer.useSpeakerphoneForVoice = false; if(! playing) { sc = music.play(pos); playing = true; } } 26
  • 27.  Microphone.isSupported  Microphone.getMicrophone()  Microphone.getEnhancedMicrophone()  Microphone.setUseEchoSuppression()  Microphone.setSilenceLevel(silenceLevel, timeout)  SampleDataEvent.SAMPLE_DATA  Microphone.activityLevel 27
  • 28. …  Front-facing camera support  Android Market licensing integration  Captive runtime support for Android  Stagetext  Flash Access on Android  Mobile background app audio playback for iOS  Enable HW Video decoding on various chipsets  Native Extensions on Mobile 28
  • 30. The native extensions feature enables the addition of third-party, native-code backed ActionScript APIs to AIR applications. Normal apps NativeExtension apps A actionscript Library with Native Code implementation 30
  • 31. Enhance Performance  Zxing:ActionScript 2000ms, Android 10ms  Expand functions  Autofocus for camera , Vibration … 31
  • 32. 32
  • 33. 33
  • 34. 34
  • 35. 35
  • 36. An Android Project Provide Native Implementation for Native Extension A Flex Library Project Provide ActionScript API for Native Extension 36
  • 37. Ane file A set of Actionscript with native code implementation A Flex Mobile Project Use the ane 37
  • 38. 38