Talking about Android, HTML5 and Javascript.
As you may know, I used Cocoon.io cloud services to convert my Ladderz HTML5 game into a native Android game. I made the port in less than five minutes without installing any software or SDK by compiling it directly on the cloud thanks to Cocoon.io which provides all the tools and services to build awesome native HTML5 apps and games with a simple workflow and all the power of Cordova. Now it’s time to write a step by step guide about this process. 1 – Obfuscate your code This is very important. Be aware your javascript is not converted into “something else”, it’s just executed into a wrapper which acts like a virtual machine inside your app. So your code will remain exactly as you made it, and although there is no “view source code” in your game, you should obfuscate it. I highly recommend Jscramber, but the free online JavaScript Obfuscator Tool has some interesting features too. 2 – Create your Cocoon.io account Go to Cocoon.io, and choose your plan. I am using the free plan which allows to completely manage up to two projects simultaneously with plugins, with a 50MB max project size, which can be raised to 250MB – with 10 projects simultaneously – for as low as $8/month, which is the plan I recommend to start with. 3 – Include cordova.js file Go to the official GitHub repository and grab the latest version. Then include it in your project, making yourindex.html
page look something like this:
<!DOCTYPE html>
<html>
<head>
<title>ZNUMBERZ</title>
<meta name = "viewport" content = "width = device-width, initial-scale = 1.0, maximum-scale = 1.0, minimum-scale = 1.0, user-scalable = 0, minimal-ui" />
<link rel = "shortcut icon" sizes = "256x256" href = "icon-256.png" />
<style type = "text/css">
* {
padding: 0;
margin: 0;
}
body{
background: #202020;
}
canvas {
touch-action-delay: none;
touch-action: none;
-ms-touch-action: none;
}
</style>
<script src="cordova.js"></script>
<script src="phaser.min.js"></script>
<script src = "game.js"></script>
</head>
<body>
</body>
</html>
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady(){
// your game here
}
bin
directory into your Java/jdk
directory then write
keytool -genkey -v -keystore my-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
for your release keystore, or
keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
for your debug keystore.
8 – Compile signing section
At this time you are readyto upload the keystore along with its passwords
Now, you can compile your Android native app, directly on Cocoon cloud Never miss an update! Subscribe, and I will bother you by email only when a new game or full source code comes out.