How To Change Admob AppID Using Firebase

 try {

    ApplicationInfo ai = getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA);
Bundle bundle = ai.metaData;
String myApiKey = bundle.getString("com.google.android.gms.ads.APPLICATION_ID");

ai.metaData.putString("com.google.android.gms.ads.APPLICATION_ID", adUnitId);//you can replace your key APPLICATION_ID here
String ApiKey = bundle.getString("com.google.android.gms.ads.APPLICATION_ID");

unit.setText(ApiKey);



} catch (PackageManager.NameNotFoundException e) {

} catch (NullPointerException e) {

}