Firefox OS Apps & Apis - WebRebels App day 2013

Post on 08-May-2015

355 views 3 download

transcript

Firefox OSUnicorns and rainbows

Jan Jongboom

@janjongboom

You already have created an app

Embrace the phone

The mobile web is broken

We’re back in 1999

We’re back in 1999

No AJAX?!

-webkit-prefix

Let’s open up the mobile web

Firefox OS app=

website + W3C proposed phone APIs

The web is awesome

So let’s get going... (nothing fancy yet)

Have a mobile webapp?

Go take a nap, we’re back in 5

github.com / comoyo / ffos-list-detail

It’s this cool!

github.com/comoyo/ffos-list-detail

Embrace the phone!

Unleash the power of WebAPIs

APIs

Certified APIs• WebTelephony• WebSMS• IdleAPI• SettingsAPI• PowerManagementAPI• MobileConnectionAPI• WiFiInformationAPI

• WebBluetooth• PermissionsAPI• NetworkStatsAPI• CameraAPI• Time/ClockAPI• Attentionscreen• Voicemail

Requires certification process

Your phone is aware of your surroundings...

Take advantage!

Camera is only available for certified apps...

Application bus

Hey I need an image!

Sure, I can provide you with one!

Web activities(like Android intents)

I NEED AN ADULT!

Offline

• Web is built for connectivity :-(

• Two types of assets:

• Application assets

• Server data

Caching assets• ZIP up your app

• Lose flexibility of the web

• But very easy!

• Use appcache

• Browser feature

• Example implementation in demo-app

Caching resources

• AJAX calls

• Cache results in indexedDB or local storage

• Read from cache if request fails

• In demo-app see the http service

The app manifest file

• Has name, description, version

• Define permissions (calling, storage)

• Appcache location (can be in html as well)

• Web activity provider (I provide images!)

https://marketplace.firefox.com/developers/docs/manifests

Get hacking!

Questions?

Twitter: @janjongboom

slideshare.net/janjongboom