Getting Started with Chrome Apps

If you know HTML,CSS and Javascript you can write chrome apps. You don’t need any other language. For that matter even you don’t need any IDE. Having chrome browser installed in your computer is enough. Of Course you need a text editor to write a code.

So lets build our HelloWorld app

The user interface is built using HTML(helloworld.html)(Here we will just print hello world)

We need two more files to complete our HelloWorld App. The first one is manifest.json which is required by Chrome to recognise your app. This file contains control and permissions information of your app. This file is coded in JSON format.

app.background: This specifies java script file from which execution will start(This will also differentiate Chrome app from extensions)

manifest_version: Chrome API which is 2 currently

name: Our app name

Version: Application version

As mentioned above the execution will start from background.js which we will write now. Here we will define application wide event handlers.One of the important event is “chrome.app.runtime.onLaunched” event, which will be fired when the application is launched.Usually we will create a window to run HTML when application is launched. Here are the contents of background.js