【Delphi XE6】在 app 播放 AdMob 廣告

form 放置一個 TBannerAd



TestMode 屬性勾選為 True



procedure Tform1.FormCreate(Sender: TObject);
begin
    adMob.AdUnitID := 'ca-app-pub-xxxxxxxxxxxxxxxx/yyyyyyyyyy';
end;

編輯 AndroidManifest.template
<meta-data android:name="com.google.android.gms.version" android:value="4323000"/> 
<activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
    
 ...
 ...
 
</activity>
<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/> 


點擊功能表 "Project"  ==> "Options..."



勾選 "Uses Permissions""Access network state""Internet"




procedure Tform1.FormShow(Sender: TObject);
begin
    adMob.LoadAd;
end;