admob

Android AdMob not showing LinearLayout on Bottom

雨燕双飞 提交于 2019-12-18 05:07:08
问题 Okay really weird situation with AdMob. I want to place the ad on the bottom I have a LinearLayout. When I do it never shows up. When I place it on top it shows up perfectly. Not sure what the deal is here is my code. I do get a warning in LogCat that says "Not enough space to show ad! Wants <480,75> Has: <480, 0>" LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/res/mypackage" android:id="@+id/mainmenulayout" android

Admob ad on custom Dialog

故事扮演 提交于 2019-12-18 04:26:25
问题 I am trying to implement Admob ads on app. What I want to do is to ad a banner ad on a custom Dialog. I have tried everything but can't find the solution. I have made a custom xml for the dialog. When adding admob on xml, it won't run. So I tried do it programmatically. But still can't make it work. public void OnClickButton(View paramView) { int btn_id = paramView.getId(); if (btn_id == R.id.hint_field) { //set up dialog if (hint != null && hint.length()>0) { final Dialog dialog = new Dialog

Should we prefer AdMob in Google Play services compared to “old” AdMob SDK

巧了我就是萌 提交于 2019-12-18 03:21:39
问题 I just realized Google embeds AdMob into latest Google Play services (4+) I was wondering, should I prefer https://developers.google.com/mobile-ads-sdk/docs/#play over https://developers.google.com/mobile-ads-sdk/docs/#android ? As I do not see Google official stand on this. The reason I ask so, I found AdMob from Google Play services is pretty buggy still. This is my observation. Create an smart banner from Java code, and place it in a middle of a scroll view. Whenever the smart banner

How to get a “hashed device id” for testing admob on ios

痴心易碎 提交于 2019-12-18 02:41:45
问题 When implementing AdMob you can define an array of test IDs so that Google knows to serve test ads to these devices, instead of real ads. However, it requires "hashed device IDs". This seems a little vague to me. What ID are they talking about and what hashing method do they expect me to use? I'm talking about the bit that should go in here: request.testDevices = @[ @"hashed-device-id" ]; 回答1: I figured out how to generate the AdMob device ID: Just compute the MD5 of the advertisingIdentifier

How to get a “hashed device id” for testing admob on ios

时光毁灭记忆、已成空白 提交于 2019-12-18 02:41:07
问题 When implementing AdMob you can define an array of test IDs so that Google knows to serve test ads to these devices, instead of real ads. However, it requires "hashed device IDs". This seems a little vague to me. What ID are they talking about and what hashing method do they expect me to use? I'm talking about the bit that should go in here: request.testDevices = @[ @"hashed-device-id" ]; 回答1: I figured out how to generate the AdMob device ID: Just compute the MD5 of the advertisingIdentifier

Is there any AdMob dummy id?

心已入冬 提交于 2019-12-17 22:36:05
问题 Is there any AdMob dummy ids for testing purpose? Do I need to register app & get MY_AD_UNIT_ID? 回答1: There aren't dummy ID's per se. You need to setup the XML or the JAVA code to get test ads. To get Test Ads during testing, add the following to your XML where you have the AdView declared. NOTE: I use just the XML code to display Ads in my app. <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="bottom|center" android:orientation="horizontal

How to get Google's example code working for AdMob 4.1.0 using an Android device

余生长醉 提交于 2019-12-17 21:29:24
问题 I want to use xml to add a banner ad to my app. To understand how to do this, I read through the Google AdMob Ads Android Banner XML tutorial. There's even example code. However, the example project doesn't display ads on my device (a Motorola xt720). I get nothing relevant in LogCat. If I go to project settings and remove the 4.0.4 jar and add the 4.1.0 jar that I downloaded with Android SDK and AVD Manager (downloaded "Google Admob Ads Sdk package, revision 2" and the file is android-sdk

Admob SMART_BANNER size

我只是一个虾纸丫 提交于 2019-12-17 19:45:25
问题 The AdSize class has getWidthInPixels() and getHeightInPixels() methods to obtain size of the ad. Although, they work correctly for BANNER, they don't work SMART_BANNER. They always return -2. Can you please suggest me a way to fetch AdView size during run-time? 回答1: If you're using the Google Play services library, you can simply use: int widthPixels = AdSize.SMART_BANNER.getWidthInPixels(this); int heightPixels = AdSize.SMART_BANNER.getHeightInPixels(this); In the old standalone Android

How to create an admob banner programmatically?

不问归期 提交于 2019-12-17 19:12:52
问题 How can i create an admob smart banner with code? my layout is completely build with code. 回答1: You can do it more or less like this: LinearLayout adContainer = <container>; AdView adView = new AdView(activity) adView.setAdSize(AdSize.SMART_BANNER); adView.setAdUnitId(<your-publisher-id>); // Initiate a generic request to load it with an ad AdRequest adRequest = new AdRequest(); adRequest.addTestDevice(AdRequest.TEST_EMULATOR); adView.loadAd(adRequest); // Place the ad view. LinearLayout

AdMob In House Ad eCPM Order

依然范特西╮ 提交于 2019-12-17 19:10:25
问题 I'm a little confused on the matter of displaying my own in house ad's along side AdMob's ads with the use of setting eCPM values for order of importance. I currently am just running one house ad along with AdMobs's network. From the FAQ and AdMob help section I've come to the understanding that this is how the allocation will work. For Example, I set AdMob's eCPM to $5.00 and my in house ad to $0.01, in this case an AdMob ad will only be shown if it's value is equal to or exceeds $5.00. If