tags:

views:

282

answers:

1

i cant seem to figure out how to add the admob widget into my application. i want to add the widget to a linearlayout that is the child of a relative layout. the linerlayout was created just for the ad.

and have it update/refresh the ad each time a button is pressed. i have already imported the JAR,edited my manifest to include the permissions and publisher id. but i cant seem to exactly figure out how to add integrate the admob code.

/facepalm. im an idiot problem solved.

A: 

There is a PDF you can download from Admob, on the same page that you downloaded the JAR file. I'd give you the link, but I think you have to be logged in to the website to get to it. You need to follow that PDF step by step. For example I don't see that you mention anything about the attrs.xml file that you need to put in your /res/values directory, or adding something like this inside your LinearLayout:

<com.admob.android.ads.AdView   
  android:id="@+id/ad"  
  android:layout_width="fill_parent"  
  android:layout_height="wrap_content" 
  myapp:backgroundColor="#000000" 
  myapp:primaryTextColor="#FFFFFF" 
  myapp:secondaryTextColor="#CCCCCC" 
/> 

Have you done all the steps in that PDF file? If so, then can you be more specific about the problem you are having.

mbaird