I have a notification app that never caught on at 99 cents. So I'm trying the free with ads model.
Problem is, Admob is slow. Its load times are as great as seven seconds after the activity displays. The activity is just a notification so the user will have closed the app before the ad had a chance to load.
I have a service that opens the activity.
Service:
Intent notificationIntent = new Intent(this, FullScreen.class);
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
NotificationManager nm = (NotificationManager) this
.getSystemService(Context.NOTIFICATION_SERVICE);
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
Notification notif;
if (currentapiVersion >= android.os.Build.VERSION_CODES.JELLY_BEAN) {
Notification.Builder builder = new Notification.Builder(context)
.setWhen(System.currentTimeMillis())
.setContentIntent(contentIntent)
notif = builder.build();
} else {
notif = new Notification.Builder(context)
.setWhen(System.currentTimeMillis())
.setContentIntent(contentIntent)
}
Admob code in Activity's onCreate (cut n pasted from admob's documentation):
AdView mAdView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
The activity is loading fast and I don't want to delay it until the AdView loads. Is there some way I can get the AdView to load during the service and then pass that to the activity? I'm guessing that there isn't. That this is by design so that people can't run up a bunch of fake ad impressions in their apps.