I found the RevMob Documentation for integration with Android.But since I am using LibGDX as my framework I am totally clueless how to do it.I did find one method for integrating AdMob. But that is a banner Ad and I want to have full screen RevMob adds. Here is the link to the RevMob Docs.Would anyone please tell me briefly how do I implement it in LibGDX?
Asked
Active
Viewed 897 times
3
-
Ey, could you post the answer? Im having the same issue – Frion3L Nov 26 '13 at 10:37
-
Here is the post that I followed : http://upandcrawling.wordpress.com/2013/07/29/libgdx-and-revmob-integration/ A word of caution: Be careful while putting the lines in the manifest file.If you copy paste, some charecters may get misinterpreted by eclipse.So it is better if you type them. – prithul Nov 26 '13 at 17:54
-
Thanks for the answer. I've already implemented it but I'm having an issue refreshing the game view. If there is a banner active on the screen and I minimize the game, after maximizing it, a lot of times the game view appears in black... :/. It just draws the banner view... do you know how to refresh the game view? :) – Frion3L Nov 26 '13 at 23:23
-
I am using admob for the banners and I dropped Revmob from my project and integrated appflood. I haven't had that problem.So sorry, can't really help with that. – prithul Dec 01 '13 at 08:35
-
Find the detailed tutorial on integrating revmob with libgdx here [http://digitalwolfstudio.in/integrating-revmob-with-libgdx](http://digitalwolfstudio.in/integrating-revmob-with-libgdx) – May 11 '14 at 17:36
-
Hi prithul, would you mind to edit the accepted answer to resolve the loop, I'd do but did not find your mentioned result of google search. If possible, could you avoid a link only answer? regard bummi – bummi May 14 '14 at 22:52
-
This is how to do platform specific stuff: http://code.google.com/p/libgdx/wiki/ApplicationPlatformSpecific http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=9072&p=41323#p41323 This is for banner ads(Admob but would work with any other, I used it in Airpush). Which uses the technique from the links above. http://code.google.com/p/libgdx/wiki/AdMobInLibgdx ;) – Daahrien Jul 27 '13 at 00:58
1 Answers
0
Try to create a Interface in the main LibGDX project and implement it in your android Project like this....
import android.content.Context;
import android.util.Log;
import com.revmob.RevMob;
import com.revmob.RevMobAdsListener;
import com.revmob.ads.fullscreen.RevMobFullscreen;
public class RevMobDisplay implements AdInterface{
public RevMobAdsListener listener;
private RevMobFullscreen fullscreen;
private MainActivity activity;
private RevMob revmob;
public RevMobDisplay(MainActivity mainActivity){
this.activity = mainActivity;
revmob = RevMob.start(activity);
//UNCOMMENT THIS CODE AFTER YOU HAVE PUBLISHED YOUR GAME LIVE
//USE WHILE TESTING YOUR GAME DURING DEVELOPMENT
revmob.setTestingMode(RevMobTestingMode.WITH_ADS);
listener = new RevMobAdsListener() {
@Override
public void onRevMobAdDisplayed() {
Log.i("[RevMob]", "onAdDisplayed");
}
@Override
public void onRevMobAdReceived() {
Log.i("[RevMob]", "onAdReceived");
}
@Override
public void onRevMobAdNotReceived(String message) {
Log.i("[RevMob]", "onAdNotReceived");
}
@Override
public void onRevMobAdDismiss() {
Log.i("[RevMob]", "onAdDismiss");
fullscreen.hide();
}
@Override
public void onRevMobAdClicked() {
Log.i("[RevMob]", "onAdClicked");
revmob.openAdLink(activity, "6753b82ad690ad146c233a6d",this);
}
};
// Pre-load it without showing it
fullscreen = revmob.createFullscreen(activity, "6753b82ad690ad146c233a6d", listener);
revmob.setTimeoutInSeconds(5);
}
@Override
public void showAds(boolean show) {
if(show){
if(fullscreen == null)
fullscreen = revmob.createFullscreen(activity, "6753b82ad690ad146c233a6d", listener);
fullscreen.show();
}
else{
fullscreen.hide();
}
}
}
Now that you have implemented everything...change the default constructor of the Main Project to something like this
initialize(new MyGame(new RevMobDisplay(this)), cfg);
Now you can easily show ads whenever you want it to show in your game by calling
MyGame.revmobAdInterface.showAds(true);
Find the detailed tutorial on integrating revmob with libgdx here

Vishal Kumar
- 4,419
- 1
- 25
- 31