本文介绍了在手机测试Admob的时候DEVICE_ID_EMULATOR和TEST_EMULATOR的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用TEST_EMULATOR和DEVICE_ID_EMULATOR之间的区别是什么?我想测试AdMob的广告系统在我的手机,不会在PC上的模拟器。

  AdRequest广告=新AdRequest.Builder()。
 .addTestDevice(com.google.ads.AdRequest.TEST_EMULATOR)。
 .addTestDevice(YOUR_HASHED_DEVICE_ID)。
 。建立();

AdRequest广告=新AdRequest.Builder()。
 .addTestDevice(com.google.ads.AdRequest.DEVICE_ID_EMULATOR)。
 .addTestDevice(YOUR_HASHED_DEVICE_ID)。
 。建立();
 

解决方案
  1. 不同的是, com.google.ads.AdRequest.TEST_EMULATOR 指的是遗留的AdMob和 com.google.android.gms.ads.AdRequest.DEVICE_ID_EMULATOR 谷歌播放服务的AdMob的版本。这已经取代了旧的遗留AdMob的。很显然,你现在应该只使用AdMob的新与旧的pcated德$ P $。

  2. 要你需要获得移动设备ID散并把它这里真正的设备上测试AdMob的广告: .addTestDevice(YOUR_HASHED_DEVICE_ID)Admob的增加了日志,在看起来或多或少像这样的logcat设备ID:

只要复制本作中的 addTestDevice 方法的参数。

What is the difference between using TEST_EMULATOR and DEVICE_ID_EMULATOR? I want to test the admob ad system on my mobile phones, NOT on an emulator on the PC.

AdRequest ad = new AdRequest.Builder().
 .addTestDevice(com.google.ads.AdRequest.TEST_EMULATOR).
 .addTestDevice("YOUR_HASHED_DEVICE_ID").
 .build();

AdRequest ad = new AdRequest.Builder().
 .addTestDevice(com.google.ads.AdRequest.DEVICE_ID_EMULATOR).
 .addTestDevice("YOUR_HASHED_DEVICE_ID").
 .build();
解决方案
  1. The difference is that com.google.ads.AdRequest.TEST_EMULATOR refers to the old legacy admob and com.google.android.gms.ads.AdRequest.DEVICE_ID_EMULATOR is the new google play services version of admob. This has replaced the old legacy admob. Obviously you should now only use the new admob as the old one is deprecated.

  2. To test admob ads on a real device you need to get the mobile device id hash and put it here: .addTestDevice("YOUR_HASHED_DEVICE_ID").Admob adds a log with the device id in the logcat that looks more or less like this:

Just copy this as a parameter in the addTestDevice method.

这篇关于在手机测试Admob的时候DEVICE_ID_EMULATOR和TEST_EMULATOR的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 14:12