gpt4 book ai didi

java - admob 测试广告 ID 正常工作,但真实 ID 广告在 Android Studio 中不起作用

转载 作者:行者123 更新时间:2023-12-01 23:07:39 26 4
gpt4 key购买 nike

我做了很可能的方法,但它不起作用我在 xml 文件中使用了相对布局和线性布局,但是不起作用,我们在 xml 文件中使用 id

XML

 <com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id">
</com.google.android.gms.ads.AdView>

java

 AdView mAdView = (AdView) findViewById(com.zapps.medical.dictionary.offlinefree.R.id.adView);
AdRequest adRequest = new AdRequest.Builder()
// .addTestDevice("A3DDA4788920C47C5C6D402059AE4245")
.build();
mAdView.loadAd(adRequest);

我们在java代码中使用banner id来

string ca-app-pub-6534443061196093/5988881403

在 list 文件中,我们使用 @integer/version 和应用程序 ID 来实现

manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zapps.medical.dictionary.offlinefree"
android:versionCode="5"
android:versionName="2.3">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<!-- <uses-sdk android:minSdkVersion="8"
android:targetSdkVersion="27" />-->

<application
android:icon="@drawable/icon_a"
android:label="@string/app_name"
android:theme="@style/LightThemeSelector">

<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-6534443061196093~8744226621"/>

<activity
android:name=".splashscreen"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Dictionary"
android:label="@string/app_name"/>

<activity
android:name=".BookMarkedWords"
android:label="Favourites"
android:parentActivityName=".Dictionary" />
<activity
android:name=".About"
android:label="About"
android:parentActivityName=".Dictionary" />
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|
screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent" />

</application>

</manifest>

这是我更改版本但仍然无法正常工作的gradle文件

gradle

    //noinspection GradleCompatible
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
}
}
compileSdkVersion 26
buildToolsVersion '28.0.3'
defaultConfig {
applicationId 'com.zapps.medical.dictionary.offlinefree'
minSdkVersion 15
targetSdkVersion 26
versionCode 4
versionName "2.1"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_5
targetCompatibility JavaVersion.VERSION_1_5
}
}

buildTypes {
release {

minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.0.0'
//implementation 'com.google.android.gms:play-services:7.0.0'
implementation 'com.google.android.gms:play-services-ads:7.0.0'

}
productFlavors {
}
}

dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
}

最佳答案

then the app will publish on play store then it will take the up-to five days to publish the app on play store and when the ad-mob ads are verified with google then the real ads will shown

关于java - admob 测试广告 ID 正常工作,但真实 ID 广告在 Android Studio 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58393931/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com