Building FirefoxOS apps with Clojurescript

27
FirefoxOS.cljs ClojureTRE/2014

Transcript of Building FirefoxOS apps with Clojurescript

Page 1: Building FirefoxOS apps with Clojurescript

FirefoxOS.cljsClojureTRE/2014

Page 2: Building FirefoxOS apps with Clojurescript

Hello, everyone!Timo Sulg

Clojure journeyman@timgluz

TauhoLabsVersionEye

Page 3: Building FirefoxOS apps with Clojurescript

Intro

Page 4: Building FirefoxOS apps with Clojurescript

ƒ

Page 5: Building FirefoxOS apps with Clojurescript

Gaia

Gonk

Kernel&HAL

Page 6: Building FirefoxOS apps with Clojurescript

The best part

ClojureScripton top of

FirefoxOS

Page 7: Building FirefoxOS apps with Clojurescript
Page 8: Building FirefoxOS apps with Clojurescript

Apis

● 3 permission levels (web, priviliged, certified)

● HTML5 (http://caniuse.com)

● Communication● Hardware● Others

Page 9: Building FirefoxOS apps with Clojurescript

WebApis for regular applications

➔ HTML5 APIs➔ Alarm API➔ Push API➔ Archive API➔ Network information➔ Ambient light sensor➔ Proximity sensor➔ ….

Regular Applications

defaulthosted

packaged

Page 10: Building FirefoxOS apps with Clojurescript

Example: deviceorientation

Page 11: Building FirefoxOS apps with Clojurescript

Privileged applications

APIS

➔ Contacts➔ Browser➔ Device storage➔ TCP Socket➔ systemXHR➔ ….

Publishing

App-storeVerifiedcertified

Page 12: Building FirefoxOS apps with Clojurescript

Certified applications - only OEM partners, money helps too

APIS

TelephonyWifi

CameraSMS

Network stats….

Page 13: Building FirefoxOS apps with Clojurescript

Webactivities

How i can call, send sms or take pics?

Delegate.

Page 14: Building FirefoxOS apps with Clojurescript

Example: phoneWord

Page 15: Building FirefoxOS apps with Clojurescript

“Use the source!”

Page 16: Building FirefoxOS apps with Clojurescript

Pult : remote control

Page 17: Building FirefoxOS apps with Clojurescript

Pult: code

● pult○ websocket + chord○ core.async

● pult-server○ http-kit○ java.awt.Robot

Page 18: Building FirefoxOS apps with Clojurescript

Pult: structure

$> lein new foxy pult

● clojurescript● manifest file● repl configuration● gitignore

Page 19: Building FirefoxOS apps with Clojurescript

Happy 25th anniversary!!

Page 20: Building FirefoxOS apps with Clojurescript

Final remarks

● no inline code● no inline CSS● no eval()● (main arg1)

● 3rd part libraries may not work● workflow: web > simulator > device

Page 21: Building FirefoxOS apps with Clojurescript

Epilogue

Page 22: Building FirefoxOS apps with Clojurescript

Epilogue

Not “cutting edge”,unbeatable HW/price,

open & popular platform

Page 23: Building FirefoxOS apps with Clojurescript

IPhone1 vs FxOs

Page 24: Building FirefoxOS apps with Clojurescript

Good fit for:

● apps● startup founders● testing mobile sites● IoT● Kickstarter DIY

○ Hackable 8-bit sound generator○ smart watering controller○ $100 red button with API

Page 25: Building FirefoxOS apps with Clojurescript

Recap

HTML5 runtimeMany APIsClojure 1.st class citizen

hacker friendlyaffordable

Page 26: Building FirefoxOS apps with Clojurescript
Page 27: Building FirefoxOS apps with Clojurescript

Links

● Pult, https://github.com/tauho/pult● App center, https://developer.mozilla.org/en-US/Apps

● APIs, https://developer.mozilla.org/en-US/docs/WebAPI

● Style guide, https://www.mozilla.org/en-US/styleguide/products/firefox-os/

● Getting started guide, http://buildingfirefoxos.com/

● Can I use HTML5 feature: http://caniuse.com/● Phone specs: http://www.thephonedatabase.com/Search_For_Phones_Running_Firefox_OS