我总是得到 admobs 的测试添加。即使我正在为 setTestDevices 设置设备 ID,我也没有看到任何真正的添加,而且我尝试了 addTestDevices 也请帮助我提前谢谢,这是我的代码..
HashSet<String> hsDevice = new HashSet<String>();
hsDevice.add(getDeviceIDforAdMob());
adRequest.setTestDevices(hsDevice);
DfpAdView adView = new DfpAdView(Base.this, AdSize.BANNER, baneerID);
adView.loadAd(adRequest);
public String getDeviceIDforAdMob()
{
String aid = Settings.Secure.getString(Base.this.getContentResolver(), "android_id");
Object obj = null;
try
{
((MessageDigest) (obj = MessageDigest.getInstance("MD5"))).update( aid.getBytes(), 0, aid.length());
obj = String.format("%032X", new Object[] { new BigInteger(1,((MessageDigest) obj).digest()) });
}
catch (NoSuchAlgorithmException localNoSuchAlgorithmException)
{
obj = aid.substring(0, 32);
}
return (String) obj;
}