Embedding ads within Recyclerview

In your adapter, you first need to override getItemViewType, for example: @Override public int getItemViewType(int position) { if (position % 5 == 0) return AD_TYPE; return CONTENT_TYPE; } Then in onCreateViewHolder, inflate a different view according to the type. Something like this: @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { View v = null; if … Read more

AdMob crashes with [GADObjectPrivate changeState:]: unrecognized selector

You need to add -ObjC to the Other Linker Flags of your application target’s build setting: Click the blue top-level project icon in XCode Choose your target and go to Build Settings Under Other Linker Flags add -ObjC for both Release and Debug Source: https://developers.google.com/mobile-ads-sdk/docs/admob/mediation#ios-linker Also be sure to do a clean and rebuild

java.util.ConcurrentModificationException in activity onCreate

In our case, we are only seeing the crash with com.google.firebase:firebase-analytics:17.2.2 reverting to 17.2.1 has fixed the problem This happens too if you are using firebase-core:17.2.2, because firebase-analytics is the same library rebranded. Take into account that as per official docs, current usage of firebase-core is deprecated -> https://firebase.google.com/support/release-notes/android#latest_sdk_versions

Ad Size and Ad unit id must be set before loadAd is called

I found solution in the github example, that is: instead of xmlns:ads=”http://schemas.android.com/apk/lib/com.google.ads” delete the xmlns:ads*** tag and add xmlns:ads=”http://schemas.android.com/apk/res-auto” tag to your LinearLayout tag as follow: <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:ads=”http://schemas.android.com/apk/res-auto” android:orientation=”vertical” android:layout_width=”match_parent” android:layout_height=”match_parent”> <TextView android:layout_width=”match_parent” android:layout_height=”wrap_content” android:text=”@string/hello”/> <com.google.android.gms.ads.AdView android:id=”@+id/adView” android:layout_width=”match_parent” android:layout_height=”wrap_content” ads:adSize=”BANNER” ads:adUnitId=”INSERT_YOUR_AD_UNIT_ID_HERE”/> </LinearLayout> That’s it 🙂 github link for this xml

Admob shows Test ads but not real ads

When apps are newly registered with AdMob, it takes some time and a few ads requests to allow inventory to build. Because of this, you may not see live impressions immediately. Once your app starts making more requests, you should see more consistent results. Please note that test ads operate through the same channels as … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)