There was no option for centering a AdMob ad so i added the last bit of code, is this code correct? My compiler throws no error and the ad does not move to the center. I cannot find any information about relative layout in reference to centering.
if(x == 0) {
adMobLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
}else if(x == -1) {
adMobLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
}else if(x == 2) {
adMobLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_CENTER);
}