com.revmob
Class RevMob

java.lang.Object
  extended by com.revmob.RevMob

public class RevMob
extends Object

Enables your application to retrieve and display RevMob ads. To use this class, you have to include in your AndroidManifest.xml file:

 <uses-permission android:name="android.permission.INTERNET"/>
 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
 <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 
 


Method Summary
 RevMobLink createAdLink(android.app.Activity activity, RevMobAdsListener listener)
          createAdLink(Activity, String, RevMobAdsListener)
 RevMobLink createAdLink(android.app.Activity activity, String placementId, RevMobAdsListener listener)
          Create and load a ad Link to be opened manually in the future, by calling its method ad.open(); Example of usage: Link ad = revmob.createAdLink(this, null, null); ad.open();
 RevMobBanner createBanner(android.app.Activity activity)
          createBanner(Activity, String, RevMobAdsListener)
 RevMobBanner createBanner(android.app.Activity activity, RevMobAdsListener listener)
          createBanner(Activity, String, RevMobAdsListener)
 RevMobBanner createBanner(android.app.Activity activity, String placementId)
          createBanner(Activity, String, RevMobAdsListener)
 RevMobBanner createBanner(android.app.Activity activity, String placementId, RevMobAdsListener listener)
          Create and load a Banner ad Example of usage: Banner ad = revmob.createBanner(this, null, null); addContentView(ad);
 RevMobFullscreen createFullscreen(android.app.Activity activity, RevMobAdsListener listener)
          createFullscreen(Activity, String, RevMobAdsListener)
 RevMobFullscreen createFullscreen(android.app.Activity activity, String placementId, RevMobAdsListener listener)
          Create and load a Fullscreen ad to be show manually in the future, by calling its method ad.show(); Example of usage: Fullscreen ad = revmob.createFullscreen(this, null, null); ad.show();
 RevMobPopup createPopup(android.app.Activity activity, RevMobAdsListener listener)
          createPopup(Activity, String, RevMobAdsListener)
 RevMobPopup createPopup(android.app.Activity activity, String placementId, RevMobAdsListener listener)
          Create and load a Popup ad to be show manually in the future, by calling its method ad.show(); Example of usage:
 RevMobTestingMode getTestingMode()
           
 void openAdLink(android.app.Activity activity, RevMobAdsListener listener)
          openAdLink(Activity, String, RevMobAdsListener)
 void openAdLink(android.app.Activity activity, String placementId, RevMobAdsListener listener)
          Create and load ad Link in a background thread.
 void openNotification(android.app.Activity activity)
          Open a previously scheduled notification.
 void printEnvironmentInformation(android.app.Activity activity)
          Print your environment information (about your device, network etc) for debugging purposes.
 RevMobNotification scheduleNotification(android.app.Activity activity, int iconDrawable)
          scheduleNotification(Activity activity, int drawableIcon, String placementId, RevMobAdsListener, Calendar)
 RevMobNotification scheduleNotification(android.app.Activity activity, int iconDrawable, String placementId)
          scheduleNotification(Activity activity, int drawableIcon, String placementId, RevMobAdsListener, Calendar)
 RevMobNotification scheduleNotification(android.app.Activity activity, int iconDrawable, String placementId, RevMobAdsListener listener)
          scheduleNotification(Activity activity, int drawableIcon, String placementId, RevMobAdsListener, Calendar)
 RevMobNotification scheduleNotification(android.app.Activity activity, int iconDrawable, String placementId, RevMobAdsListener listener, Calendar fireDate)
          Create, load and schedule a Notification ad.
 void setTestingMode(RevMobTestingMode testingMode)
          Use this method to use testing mode:
 void setTimeoutInSeconds(int timeoutInSeconds)
          You can customize the timeout to fetch the ads from the server
 void showFullscreen(android.app.Activity activity)
          #showFullscreen(Activity, String, RevMobAdsListener)
 void showFullscreen(android.app.Activity activity, String placementId)
          Create and load Fullscreen ad in a background thread.
 void showPopup(android.app.Activity activity)
          showPopup(Activity, String, RevMobAdsListener)
 void showPopup(android.app.Activity activity, String placementId, RevMobAdsListener listener)
          Create and load Popup ad in a background thread.
static RevMob start(android.app.Activity activity, String appId)
          Creates and starts a RevMob session.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

start

public static RevMob start(android.app.Activity activity,
                           String appId)
Creates and starts a RevMob session. RevMob revmob = RevMob.start(YOUR_APP_ID);

Parameters:
activity -
appId - your application's App ID, which can be generated or retrieved at http://www.revmob.com
Returns:
RevMob session object.

showFullscreen

public void showFullscreen(android.app.Activity activity)
#showFullscreen(Activity, String, RevMobAdsListener)


showFullscreen

public void showFullscreen(android.app.Activity activity,
                           String placementId)
Create and load Fullscreen ad in a background thread. After it is loaded, it will be displayed immediately, unless some error occurred. Example of usage: revmob.showFullscreen(this, null);

Parameters:
activity - Activity that will display the fullscreen. In your code, this should work fine.
placementId - The placement id. Create it on http://revmob.com. If null the default mobile app id will be used.

createFullscreen

public RevMobFullscreen createFullscreen(android.app.Activity activity,
                                         RevMobAdsListener listener)
createFullscreen(Activity, String, RevMobAdsListener)


createFullscreen

public RevMobFullscreen createFullscreen(android.app.Activity activity,
                                         String placementId,
                                         RevMobAdsListener listener)
Create and load a Fullscreen ad to be show manually in the future, by calling its method ad.show(); Example of usage: Fullscreen ad = revmob.createFullscreen(this, null, null); ad.show();

Parameters:
activity - Activity that will display the Fullscreen. In your code, this should work fine.
placementId - The placement id. Create it on http://revmob.com. If null the default mobile app id will be used.
listener - RevMob ads listener to check if the ad was loaded correctly, displayed and clicked.

createBanner

public RevMobBanner createBanner(android.app.Activity activity)
createBanner(Activity, String, RevMobAdsListener)


createBanner

public RevMobBanner createBanner(android.app.Activity activity,
                                 RevMobAdsListener listener)
createBanner(Activity, String, RevMobAdsListener)


createBanner

public RevMobBanner createBanner(android.app.Activity activity,
                                 String placementId)
createBanner(Activity, String, RevMobAdsListener)


createBanner

public RevMobBanner createBanner(android.app.Activity activity,
                                 String placementId,
                                 RevMobAdsListener listener)
Create and load a Banner ad Example of usage: Banner ad = revmob.createBanner(this, null, null); addContentView(ad);

Parameters:
activity - Activity that will display the Banner. In your code, this should work fine.
placementId - The placement id. Create it on http://revmob.com. If null the default mobile app id will be used.
listener - RevMob ads listener to check if the ad was loaded correctly, displayed and clicked.

openAdLink

public void openAdLink(android.app.Activity activity,
                       RevMobAdsListener listener)
openAdLink(Activity, String, RevMobAdsListener)


openAdLink

public void openAdLink(android.app.Activity activity,
                       String placementId,
                       RevMobAdsListener listener)
Create and load ad Link in a background thread. After it is loaded, it will be opened immediately, unless some error occurred. Example of usage: revmob.showFullscreen(this, null);

Parameters:
activity - Activity that will redirect to ad link. In your code, this should work fine.
placementId - The placement id. Create it on http://revmob.com. If null the default mobile app id will be used.
listener - RevMob ads listener to check if the ad was loaded correctly, displayed and clicked.

createAdLink

public RevMobLink createAdLink(android.app.Activity activity,
                               RevMobAdsListener listener)
createAdLink(Activity, String, RevMobAdsListener)


createAdLink

public RevMobLink createAdLink(android.app.Activity activity,
                               String placementId,
                               RevMobAdsListener listener)
Create and load a ad Link to be opened manually in the future, by calling its method ad.open(); Example of usage: Link ad = revmob.createAdLink(this, null, null); ad.open();

Parameters:
activity - Activity that will redirect to ad link. In your code, this should work fine.
placementId - The placement id. Create it on http://revmob.com. If null the default mobile app id will be used.
listener - RevMob ads listener to check if the ad was loaded correctly, displayed and clicked.

showPopup

public void showPopup(android.app.Activity activity)
showPopup(Activity, String, RevMobAdsListener)


showPopup

public void showPopup(android.app.Activity activity,
                      String placementId,
                      RevMobAdsListener listener)
Create and load Popup ad in a background thread. After it is loaded, it will be displayed immediately, unless some error occurred. Example of usage:
 revmob.showFullscreen(this, null);
 

Parameters:
activity - Activity that will display the popup. In your code, this should work fine.
placementId - The placement id. Create it on http://revmob.com. If null the default mobile app id will be used.
listener - RevMob ads listener to check if the ad was loaded correctly, displayed and clicked.

createPopup

public RevMobPopup createPopup(android.app.Activity activity,
                               RevMobAdsListener listener)
createPopup(Activity, String, RevMobAdsListener)


createPopup

public RevMobPopup createPopup(android.app.Activity activity,
                               String placementId,
                               RevMobAdsListener listener)
Create and load a Popup ad to be show manually in the future, by calling its method ad.show(); Example of usage:
 Popup ad = revmob.createPopup(this, null, null);
 ad.show();
 

Parameters:
activity - Activity that will display the popup. In your code, this should work fine.
placementId - The placement id. Create it on http://revmob.com. If null the default mobile app id will be used.
listener - RevMob ads listener to check if the ad was loaded correctly, displayed and clicked.
Returns:

scheduleNotification

public RevMobNotification scheduleNotification(android.app.Activity activity,
                                               int iconDrawable)
scheduleNotification(Activity activity, int drawableIcon, String placementId, RevMobAdsListener, Calendar)


scheduleNotification

public RevMobNotification scheduleNotification(android.app.Activity activity,
                                               int iconDrawable,
                                               String placementId)
scheduleNotification(Activity activity, int drawableIcon, String placementId, RevMobAdsListener, Calendar)


scheduleNotification

public RevMobNotification scheduleNotification(android.app.Activity activity,
                                               int iconDrawable,
                                               String placementId,
                                               RevMobAdsListener listener)
scheduleNotification(Activity activity, int drawableIcon, String placementId, RevMobAdsListener, Calendar)


scheduleNotification

public RevMobNotification scheduleNotification(android.app.Activity activity,
                                               int iconDrawable,
                                               String placementId,
                                               RevMobAdsListener listener,
                                               Calendar fireDate)
Create, load and schedule a Notification ad. Example of usage: revmob.scheduleNotification(this, R.drawable.YOUR_ICON, null, null); revmob.openNotification(this); // call this in the onCreate method

Parameters:
activity - Activity that will schedule the notification. In your code, this should work fine.
iconDrawable - R.drawable.YOUR_ICON. Mandatory to keep compatibility with older versions of Android.
placementId - The placement id. Create it on http://revmob.com. If null the default mobile app id will be used.
listener - RevMob ads listener to check if the ad was loaded correctly, displayed and clicked.
fireDate - Calendar that will be used to decide when the notification will be scheduled. If null, the RevMob servers will decide it.
Returns:

openNotification

public void openNotification(android.app.Activity activity)
Open a previously scheduled notification. This method will execute internal tasks only if the activity was created by a click in a RevMob notification. Otherwise, it will do nothing.

Parameters:
activity - Activity that will display the notification. In your code, this should work fine.

printEnvironmentInformation

public void printEnvironmentInformation(android.app.Activity activity)
Print your environment information (about your device, network etc) for debugging purposes.

Parameters:
activity - Activity that will display the popup. In your code, this should work fine.

getTestingMode

public RevMobTestingMode getTestingMode()

setTestingMode

public void setTestingMode(RevMobTestingMode testingMode)
Use this method to use testing mode:
 revmob.setTestingMode(RevMobTestingMode.WITH_ADS)
 revmob.setTestingMode(RevMobTestingMode.WITHOUT_ADS)
 revmob.setTestingMode(RevMobTestingMode.DISABLED)
 

Parameters:
testingMode -

setTimeoutInSeconds

public void setTimeoutInSeconds(int timeoutInSeconds)
You can customize the timeout to fetch the ads from the server

Parameters:
timeoutInSeconds -


Copyright © 2013. All Rights Reserved.