I'm new to InMobi and I'm trying to implement a banner ad to my app. Here's my code
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setUpBannerAd();
}
private void setUpBannerAd(){
InMobiSdk.init(MainActivity.this, MY_ID);
InMobiBanner bannerAd = findViewById(R.id.banner);
bannerAd = new InMobiBanner(MainActivity.this, BANNER_ID);
bannerAd.setListener(new InMobiBanner.BannerAdListener() {
@Override
public void onAdLoadSucceeded(InMobiBanner inMobiBanner) {
Toast.makeText(MainActivity.this, "sucess", Toast.LENGTH_SHORT).show();
}
@Override
public void onAdLoadFailed(InMobiBanner inMobiBanner,
InMobiAdRequestStatus inMobiAdRequestStatus) {
Toast.makeText(MainActivity.this, "fail", Toast.LENGTH_SHORT).show();
}
@Override
public void onAdDisplayed(InMobiBanner inMobiBanner) {
}
@Override
public void onAdDismissed(InMobiBanner inMobiBanner) {
}
@Override
public void onAdInteraction(InMobiBanner inMobiBanner, Map<Object, Object> map) {
}
@Override
public void onUserLeftApplication(InMobiBanner inMobiBanner) {
}
@Override
public void onAdRewardActionCompleted(InMobiBanner inMobiBanner, Map<Object, Object> map) {
}
});
bannerAd.load();
}
} I think i have all the needed imports as well as manifest declarations, but not entirely sure because I'm new to the platform. Test ads are turned on. Toasts do NOT even show up. Thanks for replies!