Taking your HTML5 Apps to Chrome Web Store

One of the most critical phase of game/app development, is it’s distribution. Android has Play Store and iOS has App Store. Similarly, Google provides a store to distribute your HTML5 powered Apps and games.

Google’s Chrome Store publishes Web Apps for its Chrome Web Browser and it’s all new operating system Chrome OS. Chrome OS is an HTML5 based operating system.

Distributing your HTML5 Games and Apps through such platforms can surely provide you with a huge audience. We tried to port our HTML5 sample ‘The Chat App’ to this platform and it ran perfectly on it. The source code for the ported sample is available here.

You do not require any extra effort to port your Apps/Games to this platform other than simply creating a Manifest File. Chrome Web Store has a particular format for it’s Manifest File, which each developer has to follow in order to have his App on the store.

Chrome Web Store

Unlike Firefox Marketplace which targets mobile users, Chrome Web Store is currently available for desktop versions of chrome browser and chrome OS. It requires manifest.json file.

Chrome Web Store can have two types of Web Apps – normal Web Apps and Packaged Apps. Normal Web Apps are links to hosted Web Apps whereas Packaged Apps look and feel like native desktop Apps. Packaged Apps do not open in a new tab in chrome browser, rather they have their own window like any other native App.

To create a web App, you require a manifest.json file which looks like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"name": "The Chat App",
"description": "A Chat application powered by AppWarp",
"version": "0.0.0.1",
"manifest_version": 2,
"icons": {
"128": "icon_128.png"
},
"app": {
"urls": [
"http://appwarp.shephertz.com/wp-content/themes/twentytwelve/Demo/html5chat/"
],
"launch": {
"web_url": "http://appwarp.shephertz.com/wp-content/themes/twentytwelve/Demo/html5chat/"
}
}
}

Here you need to specify the web_url, to define what web page will be opened when user clicks the App’s icon. The ‘urls’ section in ‘app’ defines the domain that the App will be accessing. Other keywords – name, description,etc are self explanatory just like in Firefox OS.

Packaged Apps are slightly different. You need to create an additional JavaScript File which will run in background and control your App. The Manifest File looks like this:

1
2
3
4
5
6
7
8
9
10
11
{
"name": "Packaged Chat App",
"description": "Chat Application powered by AppWarp",
"version": "0.1",
"app": {
"background": {
"scripts": ["background.js"]
}
},
"icons": {"128": "icon_128.png" }
}

Here, ‘background’ section defines the scripts that will run in background. In our example, background.js is responsible for creating the window.

The code of background.js is:

1
2
3
4
5
6
7
8
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('index.html', {
'bounds': {
'width': 1024,
'height': 600
}
});
});

chrome.app.runtime is the namespace for runtime provided to your App to control it. We have added a listener to onLaunched event which executes as soon as a user launches the App. This event further creates a window with size 1024×600 and loads the index.html.

To run your App, Click the ‘Customize and Control Google Chrome’ Button on the top right side of Chrome Web Browser and select Extensions in the Tools option. In Extensions panel, click the load unpacked extension and select the folder which contains the manifest and App files.

chrome Taking your HTML5 Apps to Chrome Web Store

You will see your App in the Apps’ section of your Chrome Web Browser and you can access it from there.

chrome 1 Taking your HTML5 Apps to Chrome Web Store

This is how you can build Apps for the Chrome Store. Once you have developed your App, you can go to their developer’s page and submit your App.

Our AppWarp HTML5 SDK is 100% compatible with such platforms, so go on and start creating multiplayer games for these platforms too.

If you have any questions or need any further assistance, please feel free to write us at support@shephertz.com

twitter Taking your HTML5 Apps to Chrome Web Storefacebook Taking your HTML5 Apps to Chrome Web Storegoogle Taking your HTML5 Apps to Chrome Web Storelinkedin Taking your HTML5 Apps to Chrome Web Storepinterest Taking your HTML5 Apps to Chrome Web Storereddit Taking your HTML5 Apps to Chrome Web Storestumbleupon Taking your HTML5 Apps to Chrome Web Storetumblr Taking your HTML5 Apps to Chrome Web Store

Leave a Reply

Your email address will not be published. Required fields are marked *


8 × seven =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>