How to include advertisements into an Android Crosswalk project

Stats

1,466 visits, 2,720 views

Translations

This tutorial hasn't been translated.

Tools

This tutorial will explain how to include advertisements in your Android Crosswalk project.

Create a game and build it

To include advertisements in your Android game you'll have to build a Construct 2 game first and export it in the Android Crosswalk format. Once you've done that you can build the game using the steps described in this tutorial:

Android Crosswalk Tutorial

Make sure you don't add a Splash screen. The tool we will use to add advertisements will not work with the Intel XDK splashscreen option.

Splash screen off

The screenshots show the correct settings.

You've got your APK. Now what?

First download and install the AppWrapper tool from vserv.mobi. You can find the tool here:

Appwrapper download link

Run the Appwrapper tool and select the apk you wish to wrap.

Select the modules you wan't to add to your apk. In this tutorial we want to add advertisements to the apk so go to the Monetization tab and select Premium RTB launch ads and/or Premium RTB exit ads. I prefer the exit ads because they are less annoying.

Select done when you selected the desired modules.

The last thing you'll have to do is sign the apk. Locate the android keytool and run it using the following command:

keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -validity 10000

More info can be found here: Signing your applications

Enter the information from the keystore in the Appwrapper program and click Intergrate. Appwrapper creates a new file called [yourappname]_wrapped with the added advertisements.

Intel XDK exit bug

The intel XDK sometimes throws an error on the Browser.Close event. When this happens the exit ad will not be shown. You can always choose to show the launch ad to avoid this problem.

Many thanks to Raiper341 for mentioning this problem in the comments.

  • 0 Comments

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