0
I already know that I should create a block for every actvity of my application that I want to display ads, but I don’t know how do I modify the string.xml
(if any) after the first ad block has been added:
string.xml
(source of the code)
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">My Application</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
<string name="banner_ad_unit_id">ca-app-pub-3940256099942544/6300978111</string>
</resources>
I wonder if I have to add the other ad blocks to the string.xml
, but without necessarily changing the name to differentiate one from the other:
string.xml
(withdrawn from here and modified by me).
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">My Application</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
<string name="banner_ad_unit_id">ca-app-pub-3940256099942544/6300978111</string>
<string name="banner_ad_unit_id">ca-app-pub-1239402565465465/2363007813</string>
</resources>
Or if I have to change my name:
string.xml
(withdrawn from here and modified by me).
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">My Application</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
<string name="banner_ad_unit_id">ca-app-pub-3940256099942544/6300978111</string>
<string name="banner_ad_unit_id_02">ca-app-pub-1239402565465465/2363007813</string>
</resources>
Links that may be useful:
https://firebase.google.com/docs/admob/android/quick-start?hl=pt-br
https://developers.google.com/admob/android/targeting?hl=pt-br#test_ads /
https://developers.google.com/admob/android/test-ads?hl=pt-br