Java Question Need Help with RevMob

SemiKolon

Member
Licensed User
Longtime User
Hi,
I'm trying to create a library for the website revmob.com
However the ads won't show up and the app force closes right at the beginning

The code in eclipse
B4X:
package com.testpack.revmob;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Version;
import com.revmob.RevMobAds;

@ShortName("RevMob")
@Version(1.0F)
public class RevMob {

   public void showAds(BA ba)
     {
      RevMobAds.showFullscreenAd(ba.activity, "4f56aMyOwnIda20");
     }
   
}

I added the libraries
core.jar
b4ashared.jar
android.jar (sdk 10)
revmob-3.2.7.jar

I exported the java project as revmob.jar and generated a javadoc

I copied my created revmob.jar, revmob.xml and revmob-3.2.7.jar to the B4A libraries folder.

My B4A Code looks like this
B4X:
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.

End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
   Dim rev As RevMob
End Sub

Sub Activity_Create(FirstTime As Boolean)
   rev.showAds
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

The result is only a force close right after I open the app. Can anyone help me out?


------------------------------------

Edit

I figured it out. I think the problem was I was using jre7
 
Last edited:
Top