Sunday, September 8, 2013

Hello World! for Firefox OS WebApps

To build a simple Hello World run on Firefox OS:

Hello World run on Firefox OS Emulator
Hello World run on Firefox OS Emulator
  • Create a working directory to hold your source code.
  • Create a HTML file, named index.html, in the working directory.
    <html>
    <header>
     <title>Mobile-Web-App</title>
    </header>
    <body>
     <p>Hello! from <a href="http://mobile-web-app.blogspot.com/">Mobile-Web-App</a>.
    </body>
    </html>
    
  • Create another file, "manifest.webapp".
    { "name": "Hello Firefox OS",
     "description": "Hello from Mobile-Web-App",
     "launch_path": "/index.html"
    }
    

Run with Firefox OS Simulator on desktop: start Firefox browser, start Firefox OS Simulator by Tools from Firefox menu -> Web Developer -> Firefox OS Simulator.

Click on Add Directory button, browse to select your manifest.webapp. The Emulator will start and load your WebApp.

Alternative, you can click the Simulator Stopped if it is not yet started. Then click Connect button.


No comments:

Post a Comment