Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Blackberry <3 HTML5

Blackberry <3 HTML5

Presented at #hackweekend 3

Avatar for hack@weekend.my

[email protected]

April 02, 2012
Tweet

Other Decks in Technology

Transcript

  1. @BlackBerryDev @BBMYCoders Why are we here?  Personal growth 

    Enhance your knowledge  Community  The Web is a great place to be  Discover opportunities  Montization
  2. @BlackBerryDev @BBMYCoders BlackBerry Web Platform  Driven by strong Web

    standards support  Powered by WebKit  Industry leading HTML5 and CSS 3 browser http://entanglement.gopherwoodstudios.com/light http://acid3.acidtests.org http://html5test.com
  3. @BlackBerryDev @BBMYCoders BlackBerry Web Platform  Commitment to World class

    performance  JIT compiler  Hardware acceleration  AliceJS  http://blackberry.github.com/Alice/ JS
  4. @BlackBerryDev @BBMYCoders BlackBerry Web Platform  375,000 registered developers 

    Strong partnerships with industry leaders  Vibrant developer community
  5. Community Forums • Super User Forum Escalation • Spanish Forums

    Resource Center • Unified learning resources library • Tutorials, Labs, Videos, Sample Code • http://developer.blackberry.com Social Media • Twitter @BlackBerryDev • Facebook • BBM Social Platform • http://devblog.blackberry.com Regional Developer Groups • 40 developer groups World wide • Join BlackBerry Malaysian Coders • Twitter @BBmyCoders • Facebook BBMalaysianCoders BlackBerry Community
  6. @BlackBerryDev @BBMYCoders BlackBerry App World  By the numbers: 

    50 million active users  5.5 million daily downloads  60,000 applications  Monetization  Paid or Free apps  Integrated payment service  Subscriptions  Micropayments
  7. @BlackBerryDev @BBMYCoders BlackBerry App World  Excellent opportunity for developers

     Free to use  Credit card, PayPal and carrier billing  26 supported currencies  70/30 revenue split
  8. @BlackBerryDev @BBMYCoders BlackBerry WebWorks “A cross-platform HTML5 application framework for

    creating standalone BlackBerry applications using modern and standardized web technologies“
  9. @BlackBerryDev @BBMYCoders WebWorks architecture WebKit Engine WebWorks Platform Security PIM

    Storage Push Media Hardware BBM Monetization Compression Background Multi-Tasking BlackBerry Platform … Your HTML5 content http://mycityway.com
  10. @BlackBerryDev @BBMYCoders WebWorks API sample <script type="text/JavaScript"> function openVideoCamera() {

    var args = new blackberry.invoke.CameraArguments(); args.view = blackberry.invoke.CameraArguments.VIEW_RECORDER; blackberry.invoke.invoke(blackberry.invoke.APP_CAMERA, args); } </script>
  11. @BlackBerryDev @BBMYCoders Real life examples Guitar Chords (My App Catalog)

    Hollywood Bowl (LA Philharmonic) Loca FM (Vanatur World Mobile) Scoremobile (Score Media) tiff (Toronto Film Festival)
  12. @BlackBerryDev @BBMYCoders WebWorks is Open Source  http://blackberry.github.com  WebWorks

    framework  Documentation  Sample code  Community APIs  Tools  WebKit
  13.  Open your favorite text editor or IDE  Create

    index.html and config.xml index.html <html> <body> <p> Hello World </p> </body> </html> Start writing code config.xml <?xml version="1.0" encoding="UTF-8"?> <widget xmlns="http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.0.0"> <name>helloWorld</name> <content src="index.html"/> </widget>
  14. @BlackBerryDev @BBMYCoders BlackBerry Ripple mobile emulator  Development tool for

    web developers  Preview and test mobile content from an emulated BlackBerry Smartphone or PlayBook environment
  15. @BlackBerryDev @BBMYCoders BlackBerry Ripple mobile emulator  Multiple platforms supported

     WebWorks, WebWorks Tablet OS, PhoneGap, Mobile Web  Change active device  PlayBook, 9 different BlackBerry Smartphones  Device emulation support  Accelerometer, Geolocation, Push, Messaging, Events, Device & Network settings  Web inspector  Debugging and profiling
  16. @BlackBerryDev @BBMYCoders Web Inspector mobile testing  Live device profiling

    and debugging  BlackBerry 7 and BlackBerry PlayBook
  17. @BlackBerryDev @BBMYCoders BlackBerry WebWorks Packager  Transforms web assets into

    standalone BlackBerry application  Command line tool (bbwp) ~\BlackBerry WebWorks Packager\bbwp>bbwp "helloWorld.zip" [INFO] Parsing command line options [INFO] Parsing bbwp.properties [INFO] Validating WebWorks archive [INFO] Parsing config.xml [WARNING] Failed to find a <feature> element [WARNING] Failed to find the <author> element [INFO] Populating application source [INFO] Compiling WebWorks application [INFO] Packaging the bar file [INFO] Bar packaging complete [INFO] WebWorks application packaging complete
  18. @BlackBerryDev @BBMYCoders Advertising service  Embed ads in your app

     Mediation platform aggregates ad networks  Smart ads <div id="adBanner"> </div> <script type="text/javascript"> var adId= 31848; var b = new blackberry.advertising.Banner(adId, "adBanner"); </script>
  19. @BlackBerryDev @BBMYCoders Payment Service  Sell digital goods  Fremium/paid

    upgrades  Pay-per-use / Subscriptions  Secure and consistent  Paypal, carrier billing or credit cards  Integrated payment flow paymentObj = { "digitalGoodID" : "12345", "digitalGoodSKU" : "101010101", "digitalGoodName" : "Levels 11-20", "metaData" : "pin=0a12345;device=9900", "purchaseAppName" : "Puzzle Mania" }; blackberry.payment.purchase(paymentObj, onSuccess, onFailure);
  20. @BlackBerryDev @BBMYCoders BBM Social Platform  45 million users 

    2 million new users per month  100 billion messages sent per month  70% use it daily  Tightly connected communities // Users can invite *their* friends to download *your* app var bbm = blackberry.bbm.platform; var result = bbm.io.inviteToDownload(onComplete);
  21. @BlackBerryDev @BBMYCoders Tip #1: Feature Detection  Never make assumptions

    about browser behavior  User Agent does not guarantee standards support  Use feature detection instead of browser detection  E.g. Modernizr, has.js
  22. @BlackBerryDev @BBMYCoders Tip #1: Feature Detection  Browser detection (User

    agent):  Feature detection: if (window.localStorage !== undefined) { // Use local storage when it is supported window.localStorage.setItem("foo", "bar"); } else { document.cookie = "foo=bar"; //default behavior } if (navigator.userAgent.indexOf("WebKit") > 0) { //assumes that all WebKit browsers support local storage window.localStorage.setItem("foo", "bar"); } else { document.cookie = "foo=bar"; //default behavior }
  23. @BlackBerryDev @BBMYCoders Tip #2: Viewport <meta name=“viewport” content=“width=200”/> <meta name=“viewport”

    content=“initial-scale=1.0”/> http://jquerymobile.com/demos/1.0rc1/  Target scale level for screen dimension  Instruct browser how page content should be scaled
  24. @BlackBerryDev @BBMYCoders Tip #2: Viewport  Recommendations:  Support different

    screen sizes  Consider portrait vs. landscape  Don’t use both height & width viewport properties  Other helpful viewport properties  width=device-width  user-scalable=no  target-densitydpi=device-dpi <meta name="viewport" content="initial-scale=1.0">
  25. @BlackBerryDev @BBMYCoders Bonus Tip: Use Event Handlers  Event handlers

    are your friends  Which is better (A or B)? <button onclick="doSomething()">Submit</button> ... function doClick(e) { console.log(" Click event: " + e); } //A element.onclick = doClick; //B element.addEventListener("click", doClick, false);
  26. @BlackBerryDev @BBMYCoders  Choose HTML5  Use Ripple and the

    BlackBerry WebWorks SDK  Monetize your app through BlackBerry App World Putting it all together BlackBerry WebWorks Packager Your web assets BlackBerry app
  27. @BlackBerryDev @BBMYCoders Takeaways  HTML5  CSS3  Webkit 

    Open Source  Frameworks  Community  App World  Monetization