Ich lerne, Android-App von Online-Tutorials zu entwickeln, und ich habe viele Antworten von "Stackoverflow" und bin sehr dankbar für die Website und ihre Benutzer für ihre Hilfe.Hinzufügen von AdMob-Anzeigen zu meiner App
Dies ist meine erste Frage zu dieser Community/Forum. Allerdings habe ich für diese Frage viele Antworten und Tutorials auf verschiedenen Webseiten bekommen, aber kein Glück.
Ich möchte einfach AdMob-Anzeigen zu meiner App hinzufügen. Sie müssen auf allen Seiten/Aktivitäten der App erscheinen.
Bitte beachten Sie die unten genannten Codes für die App. Wenn jemand Codes einschließlich admob zur Verfügung stellen kann, würde es große Hilfe sein!
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:ads="abc"
tools:context="com.example.bhagdev.transparentbuttons10.MainActivity"
android:background="@drawable/j3"
tools:ignore="NamespaceTypo">
<ScrollView
android:layout_width="368dp"
android:layout_height="495dp"
tools:layout_editor_absoluteY="8dp"
tools:layout_editor_absoluteX="8dp"
tools:ignore="MissingConstraints">
<RelativeLayout
android:layout_width="368dp"
android:layout_height="wrap_content"
tools:layout_editor_absoluteY="8dp"
tools:layout_editor_absoluteX="8dp"
tools:ignore="MissingConstraints">
<Button
android:id="@+id/button1"
android:layout_width="368dp"
android:layout_height="wrap_content"
android:background="@drawable/button_bg_transparent"
android:text="@string/button1"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="30sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="-3dp"
android:onClick="next1"/>
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/button1"
android:background="@drawable/button_bg_transparent"
android:text="@string/button2"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="30sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="-3dp"
android:onClick="aarti"/>
<Button
android:id="@+id/button3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/button2"
android:background="@drawable/button_bg_transparent"
android:text="@string/button3"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="30sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="-3dp"
android:onClick="Thal"/>
<Button
android:id="@+id/button4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/button3"
android:background="@drawable/button_bg_transparent"
android:text="@string/button4"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="30sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="-3dp" />
<Button
android:id="@+id/button5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/button4"
android:background="@drawable/button_bg_transparent"
android:text="@string/button5"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="30sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="-3dp" />
<Button
android:id="@+id/button6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/button5"
android:background="@drawable/button_bg_transparent"
android:text="@string/button6"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="30sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="-3dp" />
<Button
android:id="@+id/button7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/button6"
android:background="@drawable/button_bg_transparent"
android:text="@string/button7"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="30sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="-3dp" />
<Button
android:id="@+id/button8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/button7"
android:background="@drawable/button_bg_transparent"
android:text="@string/button8"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="30sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="-3dp" />
<Button
android:id="@+id/button9"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/button8"
android:background="@drawable/button_bg_transparent"
android:text="@string/button9"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="30sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="-3dp" />
<Button
android:id="@+id/button10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/button9"
android:background="@drawable/button_bg_transparent"
android:text="@string/button10"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="30sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="-3dp" />
<Button
android:id="@+id/button11"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/button10"
android:background="@drawable/button_bg_transparent"
android:text="@string/button11"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="30sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="-3dp" />
<Button
android:id="@+id/button12"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/button11"
android:background="@drawable/button_bg_transparent"
android:text="@string/button12"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="30sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="-3dp" />
<Button
android:id="@+id/button13"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/button12"
android:background="@drawable/button_bg_transparent"
android:text="@string/button13"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="30sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="-3dp" />
<Button
android:id="@+id/button14"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/button13"
android:background="@drawable/button_bg_transparent"
android:text="@string/button14"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="30sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="-3dp" />
<Button
android:id="@+id/button15"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/button14"
android:background="@drawable/button_bg_transparent"
android:text="@string/button15"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="30sp"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="-3dp" />
<!-- view for AdMob Banner Ad -->
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id" />
</RelativeLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>