Vivek Viswanathan
Vivek Viswanathan Staff Engineer at Compass. Passionate about building software that pushes hardware to its limits!!

Build Android Apk for Construct 2 Games: Cordova

What this blog covers?

Once the game has been created using Construct 2, this blog outlines the steps involved in exporting the game and building the android apk using cordova tool. This blog doesn't cover uploading the apk to google play console (that process is common across all android apk)

Steps to build the Android Apk

Step-1: Install the required tools

*) Java SDK: Download and install a 64 bit version of the software available from here.

*) Node.js: Install nodejs from here. Make sure the path is set after the installation.

*) Cordova: Install Cordova plugin using npm command: 'npm install -g cordova' 

*) Android SDK: Recommend installing Android Studio and there by installing the Android SDK as well. Download Android Studio from here.

Step-2: Create project using Cordova

Now, we will have to create an empty project using Cordova. The empty project serves as the base template for our game.

> cordova createproject [project_name]

Step-3: Export the game from Construct 2

  • Fill the properties for your project

  • Export the game as a Cordova project with the appropriate options selected (see snips below)

Step-5: Integrate the exported game onto the Cordova project

  • Copy the exported contents from the directory used while exporting from construct 2. The contents would roughly look like the below:

  • Replace the contents of the "www" folder of the cordova project with the copied one.

Step-6: Build Android Apk from Cordova project

  • Add "Android" platform onto the cordova project using the below command:

> cordova platform add android

  • Build the debug version android apk using the below command:

> cordova build android

  • Build the debug version android apk using the below command:

> cordova build --release android

That's all folks!! If you see any issue with the above questions or have anything to be improved, put in your comments.

comments powered by Disqus