Okay, I’ve put up questions on here and on Unity answers, and I’m not getting much out of it. I’ve read about plugins and how they work, and I’ve looked at google’s info and admob’s wiki, and I’m stuck. It’s not clicking. I don’t get it.
And I’m desperate.
Okay, not desperate. But really want to get this working.
If anyone has figured this out and knows exactly how it works, and knows how to use Skype screen sharing, I will pay you through Paypal to walk me through it. All I need is once. If I can just see the process, I know I can figure it out, it’s just not getting through my skull at the moment.
Reply here or send me a PM with when you’d be available to do this and how much you want for it. Or if you’re a kind and generous person who is willing to do it out of, well, kindness and generosity, I’d much appreciate it, but I’m at the point of being totally willing to pay someone.
I’m having trouble just getting started. I tried using the plugin example, but saw that I needed the NDK. The NDK doesn’t have a lot of actual instruction, but it does say you need GNU Make. I went and downloaded GNU Make and run the configure, and it sits there saying Configuring MAKE for DJGPP.
I don’t know what I’m doing wrong, if these are the right steps, or what. Once I get Make working, I have no idea what to do with it. It seems like everyone is assumed to know how all this stuff works. That’s why I’m at the point of saying that I will pay someone to walk me through it. From starting with only Unity and Eclipse and getting all the way to having a working app with ads.
You don’t need the NDK for a basic, first-attempt to integrate AdMob into your application. Here is a ‘complete’ project with AdMob integrated. (I say ‘complete’ as you always need to customize it, tie it to your AdMob publisher ID etc etc).
The README.txt explains what steps I took to create the project.
Thanks much Erique. It took a bit, but I think I’m getting it.
Sort of.
It seems to be running in my app, except for two things.
First, it didn’t autolaunch the app when I ran Build Run in Unity like it normally does. I was able to launch it from the phone after that, and didn’t see any errors in the logcat. It seemed to launch everything and ran the AdMobActivity (I changed the name of the class to just AdMobActivity, is that the problem?)
Second problem, now that it’s launching, it doesn’t seem to actually be requesting ads. Admob is not showing a request, even though it did for the test program you put up there. I’m using a different app and publisher ID from Admob, but I’ve made sure that’s all right. The only thing I can think of that I’ve changed is the AdMobTestActivity.class.
I went through and built the plugin from scratch and just brought code over from the test app, changing it as it needed.
Heh, nevermind. That was it. I just needed to change it back to admobtestactivity and it worked great. I thought about it as I was typing, so I went back and tested it. Works great.
Now I just need to figure out how to get it to only show up when I want it to.
Thanks for all the help everyone. That was getting really frustrating.
For that you probably want to call Java from C#, and the only way to do that currently is through JNI. JNI generally means writing native code, but if you take a look at the OpenFeintFacade sample the native calls there are wrapped into C#. You still need to understand how JNI works (specifically Accessing Fields and Methods).
Thanks again Erique. Seeing that example made a ton more sense. I’ve got it integrated into two things now and have earned a whole $1.25! Woot.
Anyway. I noticed that the games are showing over 14 MB on install now. I didn’t think anything I added with the plugin should be that big. Just to compare, for one game I have a lite and a paid version. The only real difference is the ads and less levels on the lite version. The lite is 14 MB and the paid is still 9 MB, so it definitely is the plugin that is making the difference.
Make sure both apps are installed to the SD card: 14 vs 9 is pretty much exactly the difference between installing to internal phone mem and external sd card. (the admob stuff should only add about 150kb (org.example.AdMobTest.jar + admob-sdk-android.jar))
I just checked both of them that I’ve done. I see the move to SD option, but its grayed out. On the regular version of one it has the move to phone option available.
Oh yes. By overriding the manifest you also override the default behavior of installing to external media. You can solve that by adding android:installLocation=“preferExternal” to the manifest, as explained here.
The tutorial was great, thanks Erique. I have ads up and running!
Now I’m trying to figure out how to align the ads to the bottom rather than the top. Is there something I can add to the manifest to move the activity to the bottom of the screen?
Not to the manifest, but you can change the relevant part of ‘AdMobTestActivity.java’:
import android.view.Gravity;
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.HORIZONTAL);
layout.setGravity(Gravity.BOTTOM);
addContentView(layout, new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
AdView adView = new AdView(this);
layout.addView(adView, new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
Make sure you rebuild the .jar file – I thought the build script took care of that, but you need to use ‘ant’ to do a manual rebuild.
hey I havnt been able to test it yet, but basically I can load this project, add my scenes, change the id, and it should export with admob? (sry if it sounds like a dumb question lol)
How would I go about integrating this to an already developed game. I am on the verge of going through the final build / bundle / upload to market process and am not sure whether to go paid or ad for revenue…
If its easy I may just try the lite/paid way of doing things on android but don’t want too many headaches this late on in the process. Is it as straight forward as the instructions you posted in the ZIP file or is there a lot more to it. I have an admob account setup so have all the ID’s and SDK’s etc etc
I really can’t get it to work. No matter what I try, I always receive an onFailedReceiveAd (right after being told that no ads are available). Won’t work in testmode either. I was guessing it might be a layout problem, the adview being to small, but on the other hand people got it to work with the examples here.
Only thing I’m unsure about is how to make sure admob knows my app id right. Is it the package name in the manifest?
Who got admob to work with unity on android and which problems occured?
Great, as it seems my code isn’t the problem… if using the lunar lander sample with my own pusblisher id it doesn’t get any ads as well, even in test mode…