SDK Concern

40 views
Skip to first unread message

Michael Starr

unread,
Nov 3, 2011, 1:57:23 PM11/3/11
to Google AdMob Ads Developers
Hey,

I am putting an AdMob ad in my app. In the guide, it says to set
target to android-13. I to accommodate this, I changed the
AndroidManifest to android:minSDKVersion to 13. How can my ads show up
in Android 2.2 if they can't get the app? I realize this a basic
question, but it has stumped me. Any help appreciated. Thanks.

Michael

mazesloup

unread,
Nov 3, 2011, 2:48:35 PM11/3/11
to google-adm...@googlegroups.com
Hi,

look at this : 

<uses-sdk android:targetSdkVersion="14" android:minSdkVersion="4"/>

target and min are not the same :)



Michael Starr

unread,
Nov 3, 2011, 3:00:03 PM11/3/11
to google-adm...@googlegroups.com
Hey,

    I figured that part out, but this has raised another question for me: how do I place my ad on the bottom of the screen. (The ad is showing up now).

I am referencing my main LinearLayout with android:layout-width & android:layout_height set to "fill_parent", in the AdActivity I have this, "adView.setGravity(Gravity.BOTTOM);".

Yet, it is not positioned in the bottom.

Thank you for any help you can offer!

Michael
--
Michael Starr
  760-522-0863

soundmaven

unread,
Nov 4, 2011, 4:11:41 AM11/4/11
to google-adm...@googlegroups.com
Michael,

It's not positioned in the bottom because setGravity() sets the gravity of the content of the view it's used on, when you need to set the gravity of the view itself. Define your layout in the XML and use android:layout_gravity, which sets the gravity of the view or layout in its parent. Alternatively, you can use RelativeLayout and position your view with android:layout_alignParentBottom.

kunal verma

unread,
Nov 4, 2011, 12:30:44 AM11/4/11
to google-adm...@googlegroups.com

To position your ad at the bottom, you need t understand how to use linear layout and relative layout,
Like if your content is in linear layout then you need to put all your content  in the xml file
Using android:marginTop and android:marginBottom,  you can put ad probably from the margintop which works better after putting all your content using android:marginTop
This is my view, its not the only way, there are others too.

kunal verma

unread,
Nov 4, 2011, 12:41:19 PM11/4/11
to google-adm...@googlegroups.com

Yeah and for this he needs to align all his app data with relative layout instead of previously used linear layout,
Can be a bit of hard work but worth it.

Jim

unread,
Nov 4, 2011, 2:28:07 PM11/4/11
to Google AdMob Ads Developers
Michael,

This thread might help, if you're trying to "float" the ad along the
bottom of the screen:

http://groups.google.com/group/google-admob-ads-sdk/browse_thread/thread/a540ec8fae17f803#

-Jim

On Nov 4, 11:41 am, kunal verma <kunal0072...@gmail.com> wrote:
> Yeah and for this he needs to align all his app data with relative layout
> instead of previously used linear layout,
> Can be a bit of hard work but worth it.
> On Nov 4, 2011 10:06 PM, "soundmaven" <soundma...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Michael,
>
> > It's not positioned in the bottom because *setGravity()* sets the gravity
> > of the *content* of the view it's used on, when you need to set the
> > gravity of the view itself. Define your layout in the XML and use *
> > android:layout_gravity*, which sets the gravity of the view or layout in
> > its parent. Alternatively, you can use RelativeLayout and position your
> > view with *android:layout_alignParentBottom*.
Reply all
Reply to author
Forward
0 new messages