GitHub website innit.

Twitter CV GitHub

Ally's github site.

Ally leads the work on iOS, Android and Windows Mobile PhoneGap plugin development to enhance HTML5 games at Wizcorp. Ally is an early adopter to PhoneGap and loves solving demanding HTML5 challenges with PhoneGap plugins. Wizcorp is a Tokyo based mobile games & middleware company that has partnered with publishers such as GREE, Capcom and Take2.

Posted by: Ally

04 Sep 2013

Updating a Project to Cordova 3.0

Part 2 - Android

As mentioned previously:

This is a quick tutorial on creating a Cordova 3.0 project without CLI. It might be that you are upgrading an existing bulky project or whatever. Currently if you want to use Cordova 3.0 or any CLI you have to a make new project from scratch (using CLI)…


However, this tutorial will show you how to make or update to Cordova 3.0.


Here is a quick step-by-step starting with a completely empty project (check what you need to change for your existing project). For iOS see part 1.


  • Create a new Android project. For this tutorial i’m using Android Stuido, you don’t have too, but i’ll consider you clinically insane if you use Eclipse…
  • Create a libs folder at project root and add Cordova 3.0 jar to your project. For the purpose of this tutorial, here’s something I made earlier.
  • Create an assets at project root, then a www folder in side that.
  • Add the following files to www using Android Studio or your local file/window client (Finder / Windows Exporer);


Something like this;

<!DOCTYPE html>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
		<meta charset="utf-8">
		<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
		<script type="text/javascript">
		function onBodyLoad() {
			document.addEventListener("deviceready", onDeviceReady, false);
		function onDeviceReady() {
		    alert("Awesome, Cordova is ready to rock!");
	<body onload="onBodyLoad()">
 		<p>A simple index file.</p>




OPTIONAL - If you have plugins, create a file that looks like;

cordova.define('cordova/plugin_list', function(require, exports, module) {		module.exports = [
	   	"file": "<file path to your plugin.js relative to /www/>",       			"id": "<an id for your plugin e.g.>",       			"clobbers": [

In Android Studio it’s time to add a little bit of Java; (or whatever you have call your new project)

Your main activity class should extends DroidGap thus you will be prompted to add import org.apache.cordova.DroidGap

Next in the onCreate override make sure to have the lines below;



Add config.xml to res/xml/ (create xml directory if not existing)

Here is a sample config.xml;

<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.helloCordova" version="1.0.0" xmlns="">
	<name>Hello Cordova</name>
	A sample Apache Cordova application that responds to the deviceready event.
	<author email="" href="">
    Apache Cordova Team
	<content src="index.html" />
	<feature name="LocalStorage">
    	<param name="ios-package" value="CDVLocalStorage" />
	<access origin="*" />
	<preference name="KeyboardDisplayRequiresUserAction" value="true" />
	<preference name="SuppressesIncrementalRendering" value="false" />
	<preference name="UIWebViewBounce" value="true" />
	<preference name="TopActivityIndicator" value="gray" />
	<preference name="EnableLocation" value="false" />
	<preference name="EnableViewportScale" value="false" />
	<preference name="AutoHideSplashScreen" value="true" />
	<preference name="ShowSplashScreenSpinner" value="true" />
	<preference name="MediaPlaybackRequiresUserAction" value="false" />
	<preference name="AllowInlineMediaPlayback" value="false" />
	<preference name="OpenAllWhitelistURLsInWebView" value="false" />
	<preference name="BackupWebStorage" value="cloud" />
	<preference name="fullscreen" value="true" />
	<preference name="webviewbounce" value="true" />

OPTIONAL - If you have plugins add to the config.xml inside the <widget> tag (just aobve <access origin="*" /> is fine):

(Below assumes the plugin class is GreatPlugin.m and your Cordova.exec will call “GreatPlugin”)

<feature name="GreatPlugin">
    <param name="ios-package" value="GreatPlugin" />
    <param name="onload" value="true" />