Admob module for Android

Monkey Forums/Monkey Code/Admob module for Android

pantson(Posted 2012) [#1]
Hi

I've now written a module for AdMob
http://www.mediafire.com/?tc0zhpictsq8mdv
The module also has dummy code for HTML5

I've included a test app and the templates.

You still need to manually change the main.xml, android manifest file (see templates folder) and copy the android SDK jar file into the build folder for your project.

So what does this module do?
Function Main:Int()
	New AdTest()
	
	AdMobInit("a14f0c5d9581fb1")
	AdMobTop()
	
	Return 0
End Function

places the as at the top of the screen or..

Function Main:Int()
	New AdTest()
	
	AdMobInit("a14f0c5d9581fb1")
	AdMobBottom()
	
	Return 0
End Function

places the ad at the bottom of the screen

code for hiding and showing the ads
  Method OnUpdate:Int()
	If MouseHit(MOUSE_LEFT)
		If show=1
			AdMobHide()
		Else
			AdMobShow()
		End
		show=1-show
	End
    Return True
  End Method


It will also decide if you need the larger ad LEADERBOARD for tablets or the smaller BANNER ad for mobile devices and Initiate the correct ad


replace "a14f0c5d9581fb1" with your AD_UNIT_ID

would be nice if someone could take this module and expand it out for iOS

the lib has been tested on V47d (nothing beyond atm) and also works in portrait. (not tested landscape mode)

Also the HTML5 does not connect to Admob or display anything, it just allows you to compile in HTML5 without changing code

More info
http://www.monkeycoder.co.nz/Community/posts.php?topic=1121


pantson(Posted 2012) [#2]
V1.11
http://www.mediafire.com/?i9cxinbnbh1u8zq

- updated files with better comments
- added AdMobHeight() command


CopperCircle(Posted 2012) [#3]
Thanks, that's gonna be helpful.


pantson(Posted 2012) [#4]
V1.21 now released
http://www.mediafire.com/?chuj9ymwhb4vbtv

Fixed detection of large and small devices. Moved Width detection of device to Android as Monkey DeviceWidth() was returning 0

No change to public command set. No changes required to your code


Raz(Posted 2012) [#5]
Hey nicely done :)

Out of interest (and because I can't check right now).. in landscape mode do the ads take the whole width?


pantson(Posted 2012) [#6]
dont really know... not done any testing in Landscape mode..

I'll try some later.. I got a big issue with a diff project to fry.


Raz(Posted 2012) [#7]
Sorry, I just read the rest of your posts properly to see you had already mentioned that!


visionastral(Posted 2012) [#8]
Hey Pantson, THANK YOU VERY MUCH! :D

This community is really great: any time I have a doubt on something, someone else has already done a module for it! xD


Aman(Posted 2012) [#9]
Thank you very much. I was thinking of doing this myself. This is really helpful.


benmc(Posted 2012) [#10]
I was trying this out and ran into a few things:

1) When running in Landscape mode, I had to turn AdSize.IAB_LEADERBOARD into AdSize.IAB_BANNER or nothing would display. This seemed to be due to lack of inventory, but I couldn't get my house ads to come up either - also possibly due to the house ads being a banner format.

2) If I called AdMobHide() BEFORE any ads were shown in the app, I could never AdMobShow() the ad. Basically, I have to let the Ads load, display, THEN I was able to hide and show it. Could this be due to the Layout being fill_parent/wrap_content, and without content, hiding it makes that layout basically empty? So, if you aren't seeing ads, it may be because you are calling AdMobHide() before the inventory fills the ad.

3) Can you add a function for SetTestMode(bool) and then have it call request.setTesting(bool); ? Google sends through some test-mode inventory this way so it's easier to test our apps when there is no inventory to display.


Aman(Posted 2012) [#11]
The AndroidManifest.xml file needs to be updated to run with v53:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"

	package="${ANDROID_APP_PACKAGE}"
	
	android:versionCode="1"
	android:versionName="1.0"
	android:installLocation="auto">
	
	<uses-sdk 
		android:minSdkVersion="3"
		android:targetSdkVersion="7" />
		
	<uses-feature android:glEsVersion="0x00010001" />
		
	<application android:label="${ANDROID_APP_LABEL}" android:icon="@drawable/icon">
		<activity 
			android:name="MonkeyGame" 
			android:label="${ANDROID_APP_LABEL}"
			android:screenOrientation="${ANDROID_SCREEN_ORIENTATION}"
			android:configChanges="keyboardHidden|orientation"
			android:theme=\"@...;
			<intent-filter>
				<action android:name="android.intent.action.MAIN" />
				<category android:name="android.intent.category.LAUNCHER" />
			</intent-filter>
		</activity>
		<activity android:name="com.google.ads.AdActivity"
              android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
      	</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>



Aman(Posted 2012) [#12]
I got it working fine for me while debugging but it is still showing up some errors. I added the admob sdk to the libraries which took care of some of the errors but I still have these errors:

adlayout cannot be resolved or is not a field MonkeyGame.java
repeated 5 times in the following lines:
line 2437 Java Problem
line 2455 Java Problem
line 2472 Java Problem
line 2489 Java Problem
line 2496 Java Problem

simiar errors (3) with main and monkeyview as well:
main cannot be resolved or is not a field MonkeyGame.java line 584 Java Problem
main cannot be resolved or is not a field MonkeyGame.java line 2418 Java Problem
monkeyview cannot be resolved or is not a field MonkeyGame.java line 586 Java Problem

4 errors in AndroidManifest.xml:
error: Error: String types not allowed (at 'configChanges' with value 'keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize'). line 28 Android AAPT Problem
error: No resource identifier found for attribute 'glEsVersion' in package 'android' line 14 Android AAPT Problem
error: No resource identifier found for attribute 'installLocation' in package 'android' line 2 Android AAPT Problem
error: No resource identifier found for attribute 'targetSdkVersion' in package 'android' line 10 Android AAPT Problem

Edit:
Never mind I got it working


pantson(Posted 2012) [#13]
theres some good finds and questions there...

In the library the code does not set up the XML for you (it could, but I didnt as my XML does other things too)

I could write it so that there are 2 parameters to the init function.
If the second is set, then it will add the AD to that view, else it coulf create a view for you.

BenMC
The views are strange.. if the view is created and its not big enough to house the ads then they wont show, if the view is bigger then it will scale a BANNER ad but not a leaderboard in this case.
As you are initiating a LEADERBOARD ad, the yes no house BANNER ads will show.

Not sure about the hiding beofre showing.. I never had that at it doesn't affect my apps. Maybe its one the many diff device features.

I did set the function up originally so that it defaulted in test mode. But it looked like they changed the test mode functions and you needed to put the ID of your device there and not just turn on a global setting. I will look back into it.


OvineByDesign(Posted 2012) [#14]
pantson - any chance of a repost of your code ? the links are all dead

/StuC


OvineByDesign(Posted 2012) [#15]
anyone else got a link ?

/StuC


silentshark(Posted 2012) [#16]
Sounds like a great thing to share if anyone else has got this..

Kudos to pantson for taking the time to develop and share this.


Xaron(Posted 2012) [#17]
Hey Rich, yes please put up your code again. I could put it on my server, might be better than shared file hosting.

I've contacted him via Twitter. :)


pantson(Posted 2012) [#18]
Hi everyone..
I'm back from the dead (not dead just laid up with bad back)
I've reposted the code here.. http://www.sendspace.com/file/bewe37
(click on "Click here to start download from sendspace")

Xaron, if you want to host it somewhere more permanent then please feel free to do so..

I have not looked back any code so its still at v1.21
Google have also released v6 of admob java lib with extra features. My lib does not use these extra features but does work with v6

If anyone feels like they want to make it better then please do so.


OvineByDesign(Posted 2012) [#19]
Thanks for the repost.... :)

/StuC


Xaron(Posted 2012) [#20]
Thanks Rich! I've put it on my space: http://www.xaron.net/dl/monkey/MonkeyAdmob_v1_21.zip


silentshark(Posted 2012) [#21]
That's great, many thanks, Rich.


Xaron(Posted 2012) [#22]
BTW: If you want to use the latest Monkey version you have to alter the xml template files.


silentshark(Posted 2012) [#23]
Thanks, Xaron, could you post how the xml files need to look?


silentshark(Posted 2012) [#24]
Ok, well I've done some experimenting.. I think I'm getting there - put the .xml files in the right places, installed the admob module etc.

It's failing on compilation at the moment, tho', I'm getting the same error as Aman (above) was getting, namely errors complaining that a symbol isn't found. Any clues where I should look?

[javac] Compiling 3 source files to C:\Users\red\Dropbox\MonkeyPro56\tom\zombiesshootem2.build\android\bin\classes
[javac] C:\Users\red\Dropbox\MonkeyPro56\tom\zombiesshootem2.build\android\src\com\monkey\MonkeyGame.java:2114: cannot find symbol
[javac] symbol : variable adlayout
[javac] location: class com.monkey.R.id
[javac] LinearLayout layout = (LinearLayout)MonkeyGame.activity.findViewById(R.id.adlayout);


Xaron(Posted 2012) [#25]
silentshark, I've put up an updated version here: http://www.xaron.net/dl/monkey/MonkeyAdmob_v1_22.zip

This should compile with the latest Monkey 56b as your error looks like what I've got with the old xml files.


silentshark(Posted 2012) [#26]
Thanks, Xaron, I will give it a try and report back.


silentshark(Posted 2012) [#27]
Update - thanks, Xaron, the example in the zip file is now compiling for, so I'm a step further forward. I needed to delete the android folder in the ads.build folder first.

I'm on v56, not v56b, but it still compiles

Now to try with my project again.. then see if ads appear!

Massive thanks for your help!


Xaron(Posted 2012) [#28]
No problem, glad it works! :) Admob is great. I really like it!


silentshark(Posted 2012) [#29]
It worked - ads now appearing. Many thanks Xaron and Rich for your help.


silentshark(Posted 2012) [#30]
At least it works in the Bluestacks android emulator. But when I install on my phone (Samsung Galaxy S2, running ICS), the game runs, but no ads appear.

Other freebie games - including scortched monster which is written in Monkey - have ads appearing, so I'm confused!

Any pointers from the Admob ninjas?

Update #1 - also the ads.monkey test application which comes in the admob zip file behaves the same way (fine in the emulator, no ads on my android mobile..)

Update #2 - ok, looks like it works in portrait mode, but not landscape.. which is a PITA, as my game is landscape only :-(

Update #3 - Update #3 - right, found the same issue as benmc (above). I had to change the admob.android.java file to only use AdSize.BANNER rather than
AdSize.IAB_LEADERBOARD.

Now I get ads appearing in my android game on my android phone, in landscape mode.. good news


Volker(Posted 2012) [#31]
Some help appreciated.

What I have done:
Installed a fresh MonkeyV56b.
Copy admob module from MonkeyAdmob_v1_22.zip in monkey modules folder.
Copy folder testads from same zip.
Delete ads.build folder in testads.
Compile ads.monkey. Failure, of course (no skd).
Copy GoogleAdMobAdsSdk-6.0.0.jar in \ads.build\android\libs
Compile again.

What I get:

[javac] Compiling 2 source files to D:\MonkeyProjects\AdmobTest\ads.build\android\bin\classes
[javac] D:\MonkeyProjects\AdmobTest\ads.build\android\src\com\monkey\MonkeyGame.java:2114: cannot find symbol
[javac] symbol : variable adlayout
[javac] location: class com.monkey.R.id
[javac] LinearLayout layout = (LinearLayout)MonkeyGame.activity.findViewById(R.id.adlayout);

Have I missed something?


Xaron(Posted 2012) [#32]
Have you deleted the build folder in between these steps (after the failure)?


Compile ads.monkey. Failure, of course (no skd).
Copy GoogleAdMobAdsSdk-6.0.0.jar in \ads.build\android\libs
Compile again.



Edit: oh and copy the sdk to the monkey/target/android folder. So it should look like:

/MonkeyPro/targets/android/libs/GoogleAdMobAdsSdk-6.0.0.jar

The libs folder isn't there normally so you have to create it. That way it should compile in the first run.


Volker(Posted 2012) [#33]
Got it working.
I've putted the files from template folder in MonkeyAdmob_v1_22.zip
in ads.build/android instead of ads.build/android/templates.
Have never been so happy to see advertising on my phone :-). Thanks.


Xaron(Posted 2012) [#34]
LOL. Glad it worked! Actually I'm quite satisfied with Admob. For every 100,000 requests I get around $25 revenue. ATM that's about $10 per day for our game Battleships.


Lugato(Posted 2012) [#35]
Hi,

First thankīs for make the module :)

I have a question .. when I tested my application using the admobID that exist in example:
AdMobInit("a14f0c5d9581fb1")

The banner working, but when I changed the admobID with my key, the banner donīt appear. I searched in the module/template and the unique local that exist this information is AdMobInit(). Exist another thing to do in admob when Iīll create the key ??

any help will be appreciate :)

thks


Volker(Posted 2012) [#36]
I see this permissions in the AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.GET_ACCOUNTS"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

Internet and access network state is important for Admob.
But why are there the other ones?
Especially GET_ACCOUNTS?
Are they needed for admob or can I remove them?

The forum got a Preview Button. Nice!


Rus(Posted 2012) [#37]
Hi! Would it be possible to get a link to your Battleships game Xaron? I tried a search on Google Play and found a few battleship style games and I'm not sure if yours is one of them. I'd love to see how you've implemented AdMob in the app. Cheers!


Xaron(Posted 2012) [#38]
Ah sure Rus, here it is:

https://play.google.com/store/apps/details?id=com.codeknitters.battleshiplite


pantson(Posted 2012) [#39]
volker, you maybe correct here
from https://developers.google.com/mobile-ads-sdk/docs/android/fundamentals#permissions
  <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>


The 4 permissions might be left over from my games using openfient (and other ad networks)

On a different note, my latest game is landscape, so will have to start looking at Landscape ads soon. Watch this space


Volker(Posted 2012) [#40]
I removed the other permissions and the ads work.
Landscape mode works too.
The admob.android.java must be edited.
"I had to turn AdSize.IAB_LEADERBOARD into AdSize.IAB_BANNER or nothing would display" like Benmc mentioned above.


benmc(Posted 2012) [#41]
In our games on Android, we ONLY use the android.permission.INTERNET and android.permission.ACCESS_NETWORK_STATE permissions and the ads seem to work fine. Yes, we had to change LEADERBOARD to BANNER for landscape.

Also, for Landscale, so I could center the ad on the screen, I changed the main.xml layout as follows:




I'd love to get this module working for iOS. If I were to start looking into this, does anyone know if there's a reason it isn't working already? Is there some reason this may not be possible as a module?


pantson(Posted 2012) [#42]
I'm in the final testing now for a new version of this module for Android.
The new module, should (fingers crossed), allow portrait and landscape ads and also allow Ads on the fly with altering the main.xml file

Watch this space!

BTW i may look into iOS at some point ;-)


Raz(Posted 2012) [#43]
Pantson nice one :D Will landscape ads be 100% width, or can I put an ad in the bottom left/right corner?


pantson(Posted 2012) [#44]
currently landscape will be centered top or botttm.
I could add left and right justifying too


Raz(Posted 2012) [#45]
If it's easy to do, I know it's something I will find useful :) Having the ad towards the left or right will allow for more usable game space for me (if that makes sense!)


pantson(Posted 2012) [#46]
I'll finish off this version and then add left and rigth justify at a later date. Not to late though ;-)


c.k.(Posted 2012) [#47]
Rich, is Xaron's hosted file (1.22) the latest version, or is there a newer one available somewhere?


pantson(Posted 2012) [#48]
V1.22 is the latest release...
I'll shifting out v1.23 in the next couple of days


zoqfotpik(Posted 2012) [#49]
I'm receiving this set of errors when I try to compile:

    [javac] Compiling 3 source files to C:\Program Files (x86)\Portable Apps\MonkeyPro56b\testads\ads.build\android\bin\classes
    [javac] C:\Program Files (x86)\Portable Apps\MonkeyPro56b\testads\ads.build\android\src\com\monkey\MonkeyGame.java:2114: error: cannot find symbol
    [javac] 		LinearLayout layout = (LinearLayout)MonkeyGame.activity.findViewById(R.id.adlayout);
    [javac] 		                                                                         ^
    [javac]   symbol:   variable adlayout
    [javac]   location: class id
    [javac] C:\Program Files (x86)\Portable Apps\MonkeyPro56b\testads\ads.build\android\src\com\monkey\MonkeyGame.java:2132: error: cannot find symbol
    [javac] 		LinearLayout layout = (LinearLayout)MonkeyGame.activity.findViewById(R.id.adlayout);
    [javac] 		                                                                         ^
    [javac]   symbol:   variable adlayout
    [javac]   location: class id
    [javac] C:\Program Files (x86)\Portable Apps\MonkeyPro56b\testads\ads.build\android\src\com\monkey\MonkeyGame.java:2149: error: cannot find symbol
    [javac] 		LinearLayout layout = (LinearLayout)MonkeyGame.activity.findViewById(R.id.adlayout);
    [javac] 		                                                                         ^
    [javac]   symbol:   variable adlayout
    [javac]   location: class id
    [javac] C:\Program Files (x86)\Portable Apps\MonkeyPro56b\testads\ads.build\android\src\com\monkey\MonkeyGame.java:2166: error: cannot find symbol
    [javac] 		LinearLayout layout = (LinearLayout)MonkeyGame.activity.findViewById(R.id.adlayout);
    [javac] 		                                                                         ^
    [javac]   symbol:   variable adlayout
    [javac]   location: class id
    [javac] C:\Program Files (x86)\Portable Apps\MonkeyPro56b\testads\ads.build\android\src\com\monkey\MonkeyGame.java:2173: error: cannot find symbol
    [javac] 		LinearLayout layout = (LinearLayout)MonkeyGame.activity.findViewById(R.id.adlayout);
    [javac] 		                                                                         ^
    [javac]   symbol:   variable adlayout
    [javac]   location: class id
    [javac] Note: C:\Program Files (x86)\Portable Apps\MonkeyPro56b\testads\ads.build\android\src\com\monkey\MonkeyGame.java uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 5 errors
BUILD FAILED


Any ideas?


benmc(Posted 2012) [#50]
Look in your main.xml and be sure the ad view you added is named adlayout and you may have to recreate your build folder after changing it.


zoqfotpik(Posted 2012) [#51]
>Look in your main.xml and be sure the ad view you added is named adlayout and you may have to recreate your build folder after changing it.

Where do you mean?

Here is my current main.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"

	android:layout_width="fill_parent"
	android:layout_height="fill_parent"
	android:orientation="vertical" >

	<view class="${APP_PACKAGE}.MonkeyGame$MonkeyView"
    	android:id="@+id/monkeyview"
		android:keepScreenOn="true"
  		android:layout_width="fill_parent"
		android:layout_height="fill_parent"
		/>

<com.google.ads.AdView
            android:id="@+id/adView"
            android:layout_width="wrap_content"
            android:layout_height="50px"
            android:layout_alignParentBottom="true"
            ads:loadAdOnCreate="true"
	ads:adUnitId="YOUR_AD_ID"
            ads:adSize="BANNER" />

</RelativeLayout>



Volker(Posted 2012) [#52]
You need to have the GoogleAdMobAdsSdk-6.0.0.jar
in \Monkey\targets\android\libs
Sometimes this works for me, sometimes I althoug need to have it in
the build directory of my project too.
yourproject.build\android\libs
Don't ask me why.


zoqfotpik(Posted 2012) [#53]
Still receiving the same error:

[javac] Compiling 3 source files to C:\Program Files (x86)\Portable Apps\MonkeyPro56b\testads\ads.build\android\bin\classes
    [javac] C:\Program Files (x86)\Portable Apps\MonkeyPro56b\testads\ads.build\android\src\com\monkey\MonkeyGame.java:2114: error: cannot find symbol
    [javac] 		LinearLayout layout = (LinearLayout)MonkeyGame.activity.findViewById(R.id.adlayout);


I'm sorry for the questions but I am totally at sea as far as java goes.


benmc(Posted 2012) [#54]
There's no such view called adlayout in your main.xml

Try changing your main.xml where it says @+id/adView to @+id/adlayout

You're going to have a problem seeing ads because it still says "YOUR_AD_ID" where you need to put your Ad ID.


zoqfotpik(Posted 2012) [#55]
I see now. We'll see how it works. Thanks for your help.


zoqfotpik(Posted 2012) [#56]
Jeez.

I replaced the contents of main.xml with "a;sdlfkjasldfjla/ksdfjds."

It still gave me the same errors. So I looked and found three copies of main.xml in different directories in the /android tree. Maybe that was my fault. I was editing the wrong one and it successfully compiles.

Now I'm receiving this error on the emulator screen: "Sorry! The application Monkey Game (process com.monkey) has stopped unexpectedly. Please try again."

Other apps compile and run on Android with no problem.

Wow, this is a real bear of a process.


silentshark(Posted 2012) [#57]
Sorry to hear you're stuck. The different files floating around in the targets folder and your projects build folder can be confusing.

Maybe its worth trying things afresh?

I recently installed v60, and got admob going, and I made the following notes to remind me in the future of the steps.

1. download newest version of admob - MonkeyAdmob_v1_22.zip
2. Unzip it
3. Install admob module in Monkey modules folder
4. Copy templates folder into monkey/targets/android - windows will ask to merge, do so.
5. Copy GoogleAdMobAdsSdk-6.0.0 to monkey/targets/android/libs folder (may need to create folder)
6. Delete existing build/android folder
7. Compile with fingers crossed..

Hope this helps you.


benmc(Posted 2012) [#58]
If you replaced main.xml with ""a;sdlfkjasldfjla/ksdfjds." but you didn't delete your build folder before re-compiling, then it would compile with the old main.xml.

The main.xml you want to edit is in the Monkey folder:
targets/android/templates/res/layout/main.xml

If you want to debug where the problem is, run ddms.bat in the Android sdk tools folder and monitor the emulator. It will show you the actual errors.


CopperCircle(Posted 2012) [#59]
I just tried to use this but just get a runtime error when the app starts up even with the testads demo. It all compiles fine.

I am using GoogleAdMobAdsSdk-6.1.0.jar as that's the current version.


benmc(Posted 2012) [#60]
The problem is probably in your main.xml or manifest then. It will compile fine, but fail. Can you provide any more details?


CopperCircle(Posted 2012) [#61]
This is the error I get using ddms, if I remove the admob it all works fine:

07-24 10:41:30.845: E/AndroidRuntime(422): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.reactor15/com.reactor15.Shapes}: java.lang.ClassNotFoundException: com.reactor15.Shapes in loader dalvik.system.PathClassLoader[/data/app/com.reactor15-1.apk]


benmc(Posted 2012) [#62]
@CopperCircle Yeah, it's most likely just the name of your AdView in your main.xml not being referenced incorrectly.

Edit your main.xml and find out what the @+id is of your AdView, and then you may want to check your Manifest and the admob module code to make sure it's referencing the correct ad view.

Like what happened up earlier in this thread, try changing your main.xml where it says @+id/adView to @+id/adlayout


DeltaWolf7(Posted 2014) [#63]
Hi,

I'm trying to get this working and I have everything there apart from I am now stuck with these messages.

Any one know what I missed?

-compile:
    [javac] Compiling 3 source files to C:\Monkey\Projects\FF\f.build\android\bin\classes
    [javac] C:\Monkey\Projects\FF\f.build\android\src\com\deltawolf7\f\MonkeyGame.java:2739: error: cannot find symbol
    [javac] 		Display display = MonkeyGame.activity.getWindowManager().getDefaultDisplay();
    [javac] 		                            ^
    [javac]   symbol:   variable activity
    [javac]   location: class MonkeyGame
    [javac] C:\Monkey\Projects\FF\f.build\android\src\com\deltawolf7\f\MonkeyGame.java:2741: error: cannot find symbol
    [javac] 			adView = new AdView(MonkeyGame.activity, AdSize.BANNER, MY_AD_UNIT_ID);
    [javac] 			                              ^
    [javac]   symbol:   variable activity
    [javac]   location: class MonkeyGame
    [javac] C:\Monkey\Projects\FF\f.build\android\src\com\deltawolf7\f\MonkeyGame.java:2743: error: cannot find symbol
    [javac] 			adView = new AdView(MonkeyGame.activity, AdSize.IAB_LEADERBOARD, MY_AD_UNIT_ID);
    [javac] 			                              ^
    [javac]   symbol:   variable activity
    [javac]   location: class MonkeyGame
    [javac] C:\Monkey\Projects\FF\f.build\android\src\com\deltawolf7\f\MonkeyGame.java:2747: error: cannot find symbol
    [javac] 		LinearLayout layout = (LinearLayout)MonkeyGame.activity.findViewById(R.id.adlayout);
    [javac] 		                                              ^
    [javac]   symbol:   variable activity
    [javac]   location: class MonkeyGame
    [javac] C:\Monkey\Projects\FF\f.build\android\src\com\deltawolf7\f\MonkeyGame.java:2765: error: cannot find symbol
    [javac] 		LinearLayout layout = (LinearLayout)MonkeyGame.activity.findViewById(R.id.adlayout);
    [javac] 		                                              ^
    [javac]   symbol:   variable activity
    [javac]   location: class MonkeyGame
    [javac] C:\Monkey\Projects\FF\f.build\android\src\com\deltawolf7\f\MonkeyGame.java:2782: error: cannot find symbol
    [javac] 		LinearLayout layout = (LinearLayout)MonkeyGame.activity.findViewById(R.id.adlayout);
    [javac] 		                                              ^
    [javac]   symbol:   variable activity
    [javac]   location: class MonkeyGame
    [javac] C:\Monkey\Projects\FF\f.build\android\src\com\deltawolf7\f\MonkeyGame.java:2799: error: cannot find symbol
    [javac] 		LinearLayout layout = (LinearLayout)MonkeyGame.activity.findViewById(R.id.adlayout);
    [javac] 		                                              ^
    [javac]   symbol:   variable activity
    [javac]   location: class MonkeyGame
    [javac] C:\Monkey\Projects\FF\f.build\android\src\com\deltawolf7\f\MonkeyGame.java:2806: error: cannot find symbol
    [javac] 		LinearLayout layout = (LinearLayout)MonkeyGame.activity.findViewById(R.id.adlayout);
    [javac] 		                                              ^
    [javac]   symbol:   variable activity
    [javac]   location: class MonkeyGame
    [javac] Note: C:\Monkey\Projects\FF\f.build\android\src\com\deltawolf7\f\MonkeyGame.java uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 8 errors



MikeHart(Posted 2014) [#64]
Monkey has a build in Admob module now. No need for implementing everything.


DeltaWolf7(Posted 2014) [#65]
Doh! How did I miss that?
Just found the help in the documents...

Me = stupid....


Thank you