Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fixes some coding and configuration errors preventing ads on Android being displayed.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 Android
Octocat-spinner-32 assets
Octocat-spinner-32 src
Octocat-spinner-32 .build
Octocat-spinner-32 AndroidAds.hxproj
Octocat-spinner-32 AndroidManifest.xml
Octocat-spinner-32 MainActivity.java
Octocat-spinner-32 README.md
Octocat-spinner-32 application.nmml
README.md

NMEX Android ads fix

Use NMEX to incorporate ads into your NME applications.

  1. Copy the nmex folder and the java folder to your src folder.

  2. Copy the AndroidManifest.xml, MainActivity.java, Android folder and application.nmml to your root project directory

  3. Go to your Motion-Twin\haxe\lib\ nme\3,4,4\ templates\default\ android\ template\src\org\haxe\ nme folder and open the MainView.java. Change the class to public. Then, open the GameActivity.java and change the member variable mView to public and static GameActivity activity to public static GameActivity activity.

  4. Go to your C:\Motion-Twin\haxe\lib\ nme\3,4,4\ templates\default\ android\ template folder and open the build.xml file. Change the target value to android-13. You will need to ensure you have downloaded the Android 3.3 (android 13) SDK with the SDK manager.

  5. Create an Admob account. Click add new app/site and enter the details requested. Afterwards, click on manage and then you will see your publisherID.

  6. Call AD.showAd() and pass in your publisherID

  7. Find your device ID by running logcat and examinine the output. This can be done by opening a command prompt, changing directory to your AndroidSDK platform tools and running adb logcat > logcat.txt. Then run your app. After it has finished starting, close the command prompt and open the generated logcat.txt file. Search it for your device ID. Then, open the AdActivity.java file in the com\pixelpounce\ads folder. Replace the AdRequest.TEST_EMULATOR with your device id. Finally uncomment the adView.loadAd(request)

Something went wrong with that request. Please try again.