Intégrer Admob à mon application Android
Bonjour à tous,
Je souhaiterai ajouter une bannière Admob à la version gratuite de mon application, j'ai donc suivit un tutoriel trouvé sur un autre site.
Il me reste à intégrer le code de configuration du layeur de pub etc. sauf quoi mettre exactement à la place des paramètres mis dans l'exemple.
Pour le fichier attrs.xml :
Code:
1 2 3 4 5 6 7 8 9 10 11
| <?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="com.admob.android.ads.AdView">
<attr name="testing" format="boolean" />
<attr name="backgroundColor" format="color" />
<attr name="textColor" format="color" />
<attr name="keywords" format="string" />
<attr name="refreshInterval" format="integer" />
<attr name="isGoneWithoutAd" format="boolean" />
</declare-styleable>
</resources> |
Ainsi que dans les interfaces où je souhaite afficher ma bannière de pub :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <!-- rajouter le chemin de votre package-->
<FrameLayout .....
xmlns:admobsdk="http://schemas.android.com/apk/res/votre package"
...
>
<com.admob.android.ads.AdView
android:id="@+id/ad"
android:visibility="gone"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:backgroundColor="#000000"
app:textColor="#FFFFFF"
app:keywords="Android game"
/> |