Playing around

with Firefox OS

meet.js Warsaw

Andrzej Mazur@end3rEnclave Games
meet.js Warsaw • March 18th 2014

About me

Andrzej Mazur

Case study: Craigen

Craigen https://marketplace.firefox.com/app/craigen

Craigen's story

  • Very simple, but polished game
  • Built with ImpactJS game engine
  • Prepared and optimized for Firefox OS devices
  • Submitted to the Marketplace in minutes

Firefox OS

Firefox OS

  • Built with HTML5 and JavaScript
  • Open Source, hardware platform for the mobile Web

Firefox OS facts

Firefox OS

  • 15 countries
  • 7 mobile operators
  • 4 hardware partners
  • Aimed at emerging markets
  • Alternative to featured phones
  • Targeting low-end hardware

HTML5: The good parts

Good parts

  • Free
  • One code base
  • Thousands of developers already
  • True cross platform
  • For every device with a browser
  • Distribution through URLs
  • Ease of use, plugin-free
  • Open source code, easy to learn
  • Instant updates
  • Store independent

Available devices

Firefox OS devices

  • Stock: Alcatel One Touch Fire, LG Fireweb, ZTE Open
  • Geeksphone: Keon, Peak, Peak+, Revolution
  • New: Alcatel One Touch Fire C|E|S, ZTE Open C|II
  • New reference device: Flame, $25 smartphone
  • Tablets, TVs, smartwatches, etc

Types of applications

  • Web content (website)
  • Privileged web apps (hosted)
  • Installed web app (packaged)
  • Certified web app (OS)

Permissions

"permissions": {
  "contacts": {
    "description": "Required for autocompletion in the share screen",
    "access": "readcreate"
    },
  "alarms": {
    "description": "Required to schedule notifications"
  }
}

Web APIs

WebTelephony, Vibration API, WebSMS, Idle API, Screen Orientation, Settings API, Power Management API, Mobile Connection API, TCP Socket API, Geolocation API, WiFi Information API, Device Storage API, Contacts API, Mouse Lock API, Open WebApps, WebBluetooth, Network Information API, Battery Status API, Alarm API, Browser API, Time⁄Clock API, Web Activities, Push Notifications API, Permissions API, WebFM API, FileHandle API, Network Stats API, WebPayment, IndexedDB, Archive API, Ambient light sensor, Proximity sensor, SystemXHR, ...

Vibration API

window.navigator.vibrate(200);

Screen orientation

checkOrientation = function() {
	if(window.orientation == 0 || window.orientation == 180) {
		// "please rotate your device"
	}
	else {
		// "play the game"
	}
}

Page visibility

document.addEventListener("visibilitychange", function() {
	if(document.hidden) {
		// "app is hidden"
	}
	else {
		// "app is visible"
	}
})

App distribution

Freedom

Firefox Marketplace

Marketplace

http://marketplace.firefox.com

Install from the Web

var installapp = navigator.mozApps.install(manifestURL);
installapp.onsuccess = function(data) {
	// "App is installed"
};
installapp.onerror = function() {
	// "App wasn't installed, see installapp.error.name for info"
}

Dynamic app web search

App Search

Firefox Marketplace

Marketplace

  • Market for your apps
  • Packaged or self hosted
  • Instant install button
  • Almost no competition

Prepare your game

for the Fifefox OS platform

The manifest file

manifest.webapp

{
    "name": "My App",
    "description": "My description goes here",
    "launch_path": "/",
    "icons": {
        "128": "/img/icon-128.png"
    },
    "developer": {
        "name": "Your name or organization",
        "url": "http://your-homepage-here.org"
    },
    "default_locale": "en"
}							

The submit form

Marketplace Form

https://marketplace.firefox.com/developers/submit/

Testing the game

App Manager

about:app-manager

Adding new games

Firefox OS simulator

https://developer.mozilla.org/en-US/docs/Tools/Firefox_OS_Simulator

Pushing to the device

Remote debugging

Promote yourself and your games

Promote yourself

Distribution platforms

News sites

Articles

Competitions

Events

Monetisation

Lessons learned

Craigen in the Marketplace

  • Very easy to adapt your game
  • Documentation is ready
  • Attend events to gain experience
  • Ask questions, give feedback

Wrapping up

  • Easy to build for
  • Easy to publish
  • No limitations by the platform
  • You build for the Web, not for the Firefox OS
  • Learn, Develop, Test, Submit, ..., PROFIT!

Contest

Win Alcatel OTF with Firefox OS and the js13kGames t-shirt!

Firefox OS and js13kGames

March 18th - March 28th, sponsored by Enclave Games. Details:
blog.end3r.com/263.

Thanks! Questions?

 

Slides: end3r.com/slides/meetjs-fxos

Contest: blog.end3r.com/263

 

Andrzej Mazur@end3rEnclave Games

Ender Efka @end3r