Reputation: 35
Lets say people start my application and they click for an activity from RecyclerView
and it display interstitial ads then the application add gap for 1 min so user cant see ads even if they click for an Activity
from RecyclerView
.
When 1 min passed and they click another recycle view item for displaying another activity they can see another Intersials ads
How to implement that?
Upvotes: 3
Views: 720
Reputation: 19427
Instead of doing this programmatically, you can simply set a frequency cap for your interstitial Ad:
- Sign in to your AdMob account at https://apps.admob.com.
- Click Apps in the sidebar.
- Select the name of your app. If you don't see it in the list of recent apps, you can click View all apps to search a list of all of the apps you've added to AdMob.
- Click App settings in the sidebar.
- Click Edit beside Interstitial frequency capping.
Select an interstitial frequency capping option:
- No cap on interstitial impressions in this app: Select this option to disable frequency capping for this app.
- Enable the following cap per user: Enter the number of impressions you want to allow to appear per user across all interstitial ad units in this app and select a period of time (per minute, per hour, or per day).
Click Save.
Upvotes: 1
Reputation: 3265
You can assign current time in milliseconds in an long variable and check difference between User Click Time and the previous time. If difference was bigger than 60*1000 milliseconds show advertisement.
Getting current time in milliseconds:
long savedTime = System.currentTimeMillis();
Needed condition:
if (System.currentTimeMillis() - savedTime > 60 * 1000) { // 60,000 ms = 1 min
// Show Advertisement
}
Upvotes: 0