Last active
October 10, 2015 05:18
-
-
Save revmob-sdk/3639740 to your computer and use it in GitHub Desktop.
Android 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.revmob.sample.developer; | |
import android.os.Bundle; | |
import android.app.Activity; | |
import android.util.Log; | |
import android.view.View; | |
import com.revmob.RevMob; | |
import com.revmob.ads.link.RevMobLink; | |
import com.revmob.RevMobAdsListener; | |
public class MainActivity extends Activity { | |
// Just replace the ID below with your appID. | |
private static String APPLICATION_ID = "4f56aa6e3dc441000e005a20"; | |
private RevMob revmob; | |
private RevMobAdsListener revmobListener; | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
// Starting RevMob session | |
revmob = RevMob.start(this, APPLICATION_ID); | |
} | |
public void onStart() { | |
super.onStart(); | |
revmobListener = 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() { | |
//Not implemented. | |
} | |
@Override | |
public void onRevMobAdClicked() { | |
Log.i("[RevMob]", "onAdClicked"); | |
} | |
}; | |
} | |
public void revMobOpenAdLink(View view) { | |
//revmob.openAdLink(this, null); | |
RevMobLink link = revmob.createAdLink(this, revmobListener); | |
link.open(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.revmob.sample.developer; | |
import android.app.Activity; | |
import com.revmob.RevMob; | |
import com.revmob.ads.EnvironmentConfig; | |
public class Main extends Activity { | |
// Just replace the ID below with your appID. | |
private static String APPLICATION_ID = "4f56aa6e3dc441000e005a20"; | |
private RevMob revmob; | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
// Starting RevMob session | |
revmob = RevMob.start(this, APPLICATION_ID); | |
// Remove this line before release your app. | |
revmob.setTestingMode(RevMobTestingMode.WITH_ADS); | |
} | |
public void onStart() { | |
super.onStart(); | |
revmob.showFullscreen(this); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.revmob.sample.developer; | |
import android.app.Activity; | |
import com.revmob.RevMob; | |
import com.revmob.ads.EnvironmentConfig; | |
public class Main extends Activity { | |
// Just replace the ID below with your appID. | |
private static String APPLICATION_ID = "4f56aa6e3dc441000e005a20"; | |
private RevMob revmob; | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
// Starting RevMob session | |
revmob = RevMob.start(this, APPLICATION_ID); | |
// Remove this line before release your app. | |
revmob.setTestingMode(RevMobTestingMode.WITHOUT_ADS); | |
} | |
public void onStart() { | |
super.onStart(); | |
revmob.showFullscreen(this); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.revmob.sample.developer; | |
import android.app.Activity; | |
import com.revmob.RevMob; | |
public class Main extends Activity { | |
private static String APPLICATION_ID = "4f56aa6e3dc441000e005a20"; | |
private RevMob revmob; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
revmob = RevMob.start(this, APPLICATION_ID); | |
revmob.openNotification(this); // It must be in the onCreate method | |
} | |
public void someMethod() { | |
revmob.scheduleNotification(this, R.drawable.YOUR_ICON_IMAGE); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.revmob.sample.developer; | |
import android.app.Activity; | |
import com.revmob.RevMob; | |
public class Main extends Activity { | |
// Just replace the ID below with your appID. | |
private static String APPLICATION_ID = "4f56aa6e3dc441000e005a20"; | |
private RevMob revmob; | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
String placementId = "5236aa6f3dc441000e205b30"; | |
// Starting RevMob session | |
revmob = RevMob.start(this, APPLICATION_ID); | |
} | |
public void onStart() { | |
super.onStart(); | |
// Show fullscreen with defined placement. | |
revmob.showFullscreen(this, placementId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment