Getting Started with Firefox OS 'Hello World' App
Firefox OS, also know as Boot to Gecko [B2G] is a mobile operating system developed by Mozilla. Its a Linux operating system developed using HTML, JS, CSS along with Linux Kernel. This is still in development phase. However, you can start hacking Firefox OS right away.
First of all, lets get setup with all the tools of trade for Firefox OS Apps hacking. I hope you have Firefox Browser, if not then you can either install using yum, apt-get or even download from http://www.mozilla.org/en-US/. Once you have installed Mozilla Firefox, you need to install the Firefox OS Simulator on Firefox. To install the addon: Click on Tools->Addons. Then you can use the search box to find Firefox OS Simulator. But for now, better use this shortcut link https://addons.mozilla.org/en-US/firefox/addon/firefox-os-simulator/?src=search .
That's all we need. Now open your favorite editor and create an index.html file as follows:
<!doctype html>Now if you open the index.html in your browser, you'll see.
<html lang="en">
<head>
<title>Getting Started</title>
</head>
<body>
Hello Firefox OS
</body>
</html>
The other file that needs to be created is manifest.webapp. This file is responsible for installing our application index.html in the Firefox OS Simulator or the Geeks Phone. A basic manifest.webapp file is as follows:
{
"version":"1.0",
"name":"Getting Started",
"description":"This is a demo app for Firefox OS to get started",
"launch_path":"/index.html",
"icons":{
"16":"/img/icons/mortar-16.png",
"48":"/img/icons/mortar-48.png",
"128":"/img/icons/mortar-128.png"
},
"developer":{
"name":"Paras Nath Chaudhary",
"url":"http://tuxkiddos.blogspot.com"
},
"inistalls_allowed_from":["*"],
"default_locale":"en"
}
Then from Firefox Menu bar: Tools->Web Developer: Firefox OS Simulator open the Firefox OS Simulator Dashboard. Now use the Add Directory button to browser for the manifest.webapp file. And you'll see the Firefox OS Simulator run the app as shown as follows:
Well that was pretty easy, huh? Happy Hacking ahead.
Comments
Post a Comment