How to publish a Contruct 2 Html5 game into Android using Monaca

3

Stats

10,761 visits, 14,360 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 25 Jun, 2016. Last updated 19 Feb, 2019

A couple months ago I bought a contruct 2 game template to make a marketing proposal.

Even with my little experience, I can tell that construct 2 is a great platform for developers. However, publishing the games can be hard and expensive for a casual developer like me.

This tutorial will try to explain how to export and test the game in a painless way.

1. First we need to get the html5 version of the game

Please be aware that we don’t want the version with a frame around. Frames helps to adapt the game resolution in desktop browsers. However, that is not our our final platform.

Open your contruct 2, select export as ¨Html5 website¨ and later do not do not select to add a frame to the game, or it will look awful in the phone.

If you bought a template like I did, and already include it, you can just enter in the ¨html5¨ folder and then on folder ¨Game¨. That is the game without a frame.

2. Upload and configure it:

Now that you have the html5 game, we need to upload the game to monaca and configure it.

2.1 Upload the project

To avoid problems I advice you to use Chrome.

First we register in monaca.io and we create a project using the ¨minimum template¨ that monaca provides.

This is important because our project need the file ¨config.xml¨ that the project provides.

We need to upload the game files into the folder ¨www¨. You can delete the rest of the files in the folder except ¨config.xml¨ if you want.

2.2 Configure the project:

Now that we have uploaded the game, we need to configure it so we can publish it into Android.

2.2.1 We go to to Config –> Manage Cordova Plugins

You should enable the plugin ¨Crosswalk WebView Engine¨. This will ensure that the project works properly. As a downsides, the final app will increase its size a lot. Since 3 Mb to 24 in my experience.

You can try to disable it latter if you want and see what happens. In addition is also interesting as a low resource version of the app. The lack of Crosswalk plugging would enable compatibility with Android versions older than Android 4.

In my case disabling Crosswalk just result in an app that does not reproduce some audio files, so is worth to try.

2.2.2 We go to to Config –> Android app settings

We just fill the options, and add the pictures (app icons etc). The only interesting thing is at the end: Screen Orientation. This functionality will allow us to display your game in landscape mode.

2.3.2 We go to to Config –> Android Keystore settings

To publish an app in google play market, we need to add a certificate. An alias and a password of your election. Try to do not forget the password or in the future or you would be unable to update the app in the market.

3. Test and publish

Monaca allows to to test our apps thanks to their monaca debugger native app that you can find in the market stores. It works quite well so is good to use it.

Finally you can publish it: Build -> build for android. Then follow the steps depending on your needs and it´s done, a game ready to publish in google play.

This is the result :)

Edit by justifun: fixed hyperlink

  • 0 Comments

Want to leave a comment? Login or Register an account!