Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 3    Views: 72

piggilypoo
Aspiring developer
Profile
Posts: 172
Reg: Jun 28, 2011
San Diego
5,120
05/04/12 05:51 AM (13 years ago)

1.4 apps and Admob

I was wondering if anyone here could help me figure out how to get Admob displaying in my 1.4 apps? I tried following: http://sfnent.blogspot.com/2011/07/easy-guide-on-how-to-make-money-with.html But it doesn't work with the newest admob SDK; Those instructions cause the app to crash at launch. I also heard millennial ads are a good alternative, but I can't figure out how to get the ads implemented either. Any help would be greatly appreciated!
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
05/04/12 06:59 AM (13 years ago)
With the newest admob sdk, set google level to at least 3.2 (api level 13) - it shouldn't affect your project - and change the manifest entry to: <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
 
piggilypoo
Aspiring developer
Profile
Posts: 172
Reg: Jun 28, 2011
San Diego
5,120
like
05/04/12 02:32 PM (13 years ago)
I just switched it to Google API 3.2, added the above lines to the manifest, added this to act_home.xml: xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" <com.google.ads.AdView android:id="@+id/adView" android:layout_height="wrap_content" android:layout_width="wrap_content" ads:adUnitId="MYIDHERE" ads:adSize="BANNER" ads:loadAdOnCreate="true" android:layout_alignParentBottom="true"> </com.google.ads.AdView> And made a attrs.xml file with the following code: <?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="com.google.ads.AdView"> <attr name="backgroundColor" format="color" /> <attr name="primaryTextColor" format="color" /> <attr name="secondaryTextColor" format="color" /> <attr name="keywords" format="string" /> <attr name="refreshInterval" format="integer" /> </declare-styleable> </resources> And when I launch the app in the emulator, it crashes at launch still :/
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
05/04/12 02:46 PM (13 years ago)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.