Desarrollo con AIR para Playbook

Post on 05-Dec-2014

1.139 views 2 download

description

 

Transcript of Desarrollo con AIR para Playbook

Desarrollo con AIR para Playbook

Memo Döring

[Logo (opcional)]

Introduction

• Memo Döring– LATAM Team Lead, Developer Relations

RIM–@memodoring

What is the BlackBerry PlayBook?

• 1 GHz dual core processor• 1 GB Ram• 7" LCD display, 1024 x 600 screen resolution• 1080p HD video; H.264, MPEG4, WMV HDMI video output• High fidelity WebKit browser• Full Adobe® Flash® 10.1 support• High definition cameras

• 3MP front facing

• 5MP rear facing• Wi-Fi® 802.11 a/b/g/n• Micro USB and Micro HDMI • Weighs 0.9 lbs (400g)

Pair BlackBerry PlayBook with a BlackBerry Smartphone• Push Technology• Email, Calendar, BBM and more

Ideal for games, media, apps and uncompromised Internet• OpenGL Acceleration

Powerful QNX technology• True multi-tasking• What the web runs on!

Unleashing The Whole Web, At Blazing Speeds

What is the BlackBerry PlayBook?

Setting Up your Environment

• Downloads– Flash Builder 4.5– Tablet OS SDK– VM Ware Fusion• www.blackberry.com/developers/tabletos

• Code Signing• https://www.blackberry.com/SignedKeys/

• App World • www.blackberry.com/developers/appworld/

Setting Up your Environment

Setting Up your Environment

• The Simulator– In VMware Fusion, click File > Open.– On the Open screen, navigate to the location

where you installed the BlackBerry® Tablet OS SDK forAdobe® AIR®. • The default location is /Developer/SDKs/Research In

Motion/blackberry-tablet-sdk-<version>/BlackBerryPlayBookSimulator-<version>.

– Select the BlackBerryPlayBookSimulator.vmx file.

– Click Open.– Click OK

8

Creating Your First App

• Flash Builder project– http://bit.ly/PBfirstapp

• Signing setup– http://bit.ly/PBsignapp

blackberry-tablet.xml

• Used to specify platform specific items

• Customize your splash screen• Customize your app icon• Set app capabilities• Set Publisher tag for signing

blackberry-tablet.xml

• Custom App Icon–<icon><image>someicon.png</

image></icon>– Path is relative to the root of your app– Icon should be 86x86– Anything bigger than 90x90 will be

ignored

blackberry-tablet.xml

• Custom Splash Screen–<splashscreen>landscape.png:portrait.p

ng</splashscreen>– Image path relative to app root folder– Images should be 1024x600 and

600x1024

blackberry-tablet.xml

• Application Capalbilites– <permission>use_camera</permission>– <permission>read_geolocation</permission>– <permission>play_audio</permission>– <permission>access_internet</permission>– <permission>access_shared</permission>– <permission>record_audio</permission>– <permission>set_audio_volume</permission>– <permission>read_device_identifying_informati

on</permission>

Application and System States

• App States (Dispatched by NativeApplication)• Activated – Standard AIR Event – Event.ACTIVATE• Deactivated – Standard AIR Event –

Event.DEACTIVATE

• System States (Dispatched by QNXSystem)• Active – QNXSystemEvent.ACTIVE• Standby – QNXSystemEvent.STANDBY

• Default behaviour for Deactivated apps and System Standby is to switch app to a lower power mode

• Power Modes• Normal - periodic timer that runs at the

frame rate• Throttled - rendering is disabled and the

periodic timer runs at a maximum of 4Hz• Standby - rendering is disabled the AIR

timer is stopped entirely

Application and System States

• Automatic Mode changes (app descriptor file– <qnx><inactivePowerMode>throttled</inactivePowerMode></qnx>

• Programmatically change current mode– QNXSystem.system.powerMode = QNXSystemPowerMode.NORMAL;

QNXSystem.system.powerMode = QNXSystemPowerMode.THROTTLED;QNXSystem.system.powerMode = QNXSystemPowerMode.STANDBY;

• Transition Time– You can set the time that the Deactivate state takes to take

effect– QNXSystem.system.transitionTime = 3000; – Allows for you to finish animations, save state or any last

cleanup;

Application and System States

17

User Action Result

Tap the screen Initiates an action in the app

Drag or swipe across the screen

This action moves the content on the screen in the direction of the dragor swipe and at the corresponding rate of speed

Touch and hold a finger on an item.

This action highlights a sequence of characters, a word, a link, or an itemsuch as an email message or picture.

Pinch open or pinch close. These actions zoom in to and out from an item

A Touch-centric App

18

A Touch-centric App

User Action Result Type

Drag or swipe from the top of the screen

This action displays the menu

application-specific

Drag or swipe from the bottom of the screen

This action displays the navigator

system-wide

Drag or swipe from the left or right side of thescreen

This action switches applications

system-wide

Adding a swipe gesture//Top down swipe is left for developers to implement an //application menuprivate _menu:MyMenuBar; //Custom menu bar

private function init():void {_menu.initializeUI();app.addEventListener(QNXApplicationEvent.SWIPE_DOWN,

swipeDown);}

private function swipeDown(e:QNXApplicationEvent):void {if(! _menu.isVisible()) {

_menu.show();}

}

19

A Touch-centric App

20

A Touch-centric App

21

• Keeping the Backlight On– The maximum supported size of a BlackBerry® Tablet

OS– BlackBerry PlayBook.  Adobe® AIR® applications can

override this backlight time-out period value and keep the screen on indefinitely

if(keepLightOn) { NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;} else { NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.NORMAL;}

A Touch-centric App

Applications will be run in the directory we call "sandbox” and should not attempt to access any files outside of this directory.  

Sandbox structure •  app – app/air is read only link to where application files are

installed•  data – read/write access area. $HOME env var is set to this

directory•  tmp – system may remove files stored here any time app is

not running•  logs - stdin and stdout redirected to logs/log file; stores "core"

files•  shared - link to common location where all apps share files

 

App/data/tmp/logs are the app's private directories 

File Access

Alias PathFile.applicationDirectory (appname)/app/airFile.applicationStorageDirectory (appname)/data

File.desktopDirectory (appname)/shared/documentsFile.documentsDirectory (appname)/shared/documentsFile.userDirectory (appname)/

Shared file structure:•photos•bookmarks•misc•books

•documents•voice•downloads•music•videos

File class mapping:

File Access

Applications will be run in the directory we call Users must grant your application access to the above folders within the shared directory. To request access, you need to include the following snippet in your blackberry-tablet.xml file.  <qnx>     <action>access_shared</action> </qnx>  

File Access

• Battery level• Battery state• Hardware ID• Device OS• Device PIN• Platform Version• Vendor ID

• Capture battery events for app lifecycle

• Identify your users based on PIN

• Identify the Device OS for functionality

Device Information

Device Information

• Monitor battery levels for power consumption in your app

• Customize your app to provide the user experience

• Display battery and charging information from your app

Device Information

Camera Capabilities

• Camera class support• Ability to choose rear or

front facing camera• Camera UI class

• Ability to launch camera and take a picture of video

• CameraRoll class• Ability to select an

image from the camera roll

• Ability to add an image to the camera roll

• Key Statistics– 3 million Average Daily Downloads– 35 million Downloads of App World client – Available in 100+ Countries– 6 Languages –(EFIGS, Brazilian Portuguese)– 26 Currencies– Carrier Billing with multiple major carriers – Over 30,000 apps available for download or purchase including 2,000+ apps for BlackBerry PlayBook

• FREE to register as a vendor and FREE to submit apps and upgrades

App World

April-09

June

-09

Augus

t-09

Octob

er-0

9

Decem

ber-0

9

Febr

uary

-10

April-10

June

-10

Augus

t-10

April-09

June

-09

Augus

t-09

Octob

er-0

9

Decem

ber-0

9

Febr

uary

-10

April-10

June

-10

Augus

t-10

• Credit Card and Carrier Billing introduced in August 2010 to add to consumer payment method options

• 82% increase in gross sales with launch of AT&T carrier billing in App World 2.0

• Working with our carrier partners to expand support for carrier billing

App World

•Indonesia ranks 5th, Mexico ranks 8th, and Australia ranks 10th for global sales after less than 30 days

•LATAM and APAC consumers are growing opportunities for revenue

•New countries in the top 25– Australia, South Africa, India, Turkey,

Brazil, Singapore, Japan, Malaysia, Switzerland, South Korea, Thailand, Colombia, Venezuela, Ecuador

APAC7%

EMEA

21%

LATAM5%

NA68%

Rank Country Paid Apps Launches

1 United States April 1, 2009

2 United Kingdom April 1, 2009

3 Canada April 1, 2009

4 France July 31, 2009

5 Indonesia August 19, 2010

6 Germany July 31, 2009

7 Italy July 31, 2010

8 Mexico August 19, 20109 Netherlands July 31, 2009

10 Australia August 19, 2010

App World

• Download Tools, Sample Code, Docs, and Videos– BlackBerry® Developer Zone

www.blackberry.com/developers

• Ask for help– Support Forums

supportforums.blackberry.com

– Issue Trackerblackberry.com/developers/issuetracker

• Stay In Touch– Twitter® @BlackBerryDev

– Blog devblog.blackberry.com

• Get Connected– Developer Groups

blackberry.com/developers/community

– Alliance Program blackberry.com/partners

Getting Started

• $3M USD in Prizes – Biggest Challenge Ever!

• Series of Three Global Competitions – Best Adobe Flash or Adobe AIR app

(Now Open! April 28 – August 12, 2011)

– Most innovative BlackBerry WebWorks app on BlackBerry PlayBook tablets and

BlackBerry 6 (Opens May 9 – August 26, 2011)– Most addicting social app using the BBM Social

Platform (Opens Summer 2011)

– www.blackberrypartnersfund.com/challenge

2011 BlackBerry Developer Challenge

• New - Six Special Recognition Awards1.Best B2C application developed for a customer by an

Agency or ISV2.Most useful enterprise application 3.Best website conversion using the BlackBerry

WebWorks platform4.Most creative implementation of Super App

characteristics5.Top Performers – Most Innovative use of BlackBerry

Payment Service and/or Advertising Service6.Academic – Most compelling application created by

student or faculty

2011 BlackBerry Developer Challenge

BlackBerry Developer Conferences

Thank You.

36