Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Please allow adUnitId to be specified in strings.xml and/or MANIFEST
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mark Carter  
View profile  
 More options Apr 29 2011, 10:54 pm
From: Mark Carter <mjc1...@googlemail.com>
Date: Fri, 29 Apr 2011 19:54:19 -0700 (PDT)
Local: Fri, Apr 29 2011 10:54 pm
Subject: Please allow adUnitId to be specified in strings.xml and/or MANIFEST

I would like to be able to do something like:

adUnitId="@string/adUnitId" in the AdView XML element

but this does not seem to work.

Even better, I would like to be able to specify the adUnitId in the Manifest
(which was easily possible in the old version of the SDK).

Should be very easy (and standard) to support this.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Carter  
View profile  
 More options Apr 29 2011, 10:57 pm
From: Mark Carter <mjc1...@googlemail.com>
Date: Fri, 29 Apr 2011 19:57:56 -0700 (PDT)
Local: Fri, Apr 29 2011 10:57 pm
Subject: Re: Please allow adUnitId to be specified in strings.xml and/or MANIFEST

Note - This is concerning the Android Google Admob SDK (4.0.4)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Neil  
View profile  
 More options Apr 30 2011, 7:22 am
From: Neil <neilb...@gmail.com>
Date: Sat, 30 Apr 2011 04:22:19 -0700 (PDT)
Local: Sat, Apr 30 2011 7:22 am
Subject: Please allow adUnitId to be specified in strings.xml and/or MANIFEST

I would also be very happy to see either of those options.

Neil


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
seb  
View profile  
 More options Apr 30 2011, 5:13 pm
From: seb <genieuk2...@gmail.com>
Date: Sat, 30 Apr 2011 14:13:08 -0700 (PDT)
Local: Sat, Apr 30 2011 5:13 pm
Subject: Re: Please allow adUnitId to be specified in strings.xml and/or MANIFEST
You can do this by specifying the following in the attrs.xml file

<attr name="adUnitId" format="string"/>

and then in your AdView XML view add an attribute as follows

ads:adUnitId="YOUR_ID"

Regards


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
William Ferguson  
View profile  
 More options Apr 30 2011, 7:40 pm
From: William Ferguson <william.ferguson...@gmail.com>
Date: Sat, 30 Apr 2011 16:40:14 -0700 (PDT)
Local: Sat, Apr 30 2011 7:40 pm
Subject: Re: Please allow adUnitId to be specified in strings.xml and/or MANIFEST
Actually seb,

adUnitId="@string/adUnitId" in the AdView XML element

doesn't seem to work.
Form memory you get a bad AdMobId error in the logs.
I found I needed to specify my Id explicitly in the layout XML, which
is in multiple places for me (to handle rotation etc).

On May 1, 7:13 am, seb <genieuk2...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim  
View profile  
 More options Apr 30 2011, 7:47 pm
From: Tim <timzwie...@google.com>
Date: Sat, 30 Apr 2011 16:47:26 -0700 (PDT)
Local: Sat, Apr 30 2011 7:47 pm
Subject: Re: Please allow adUnitId to be specified in strings.xml and/or MANIFEST
We are working on a fix to allow string resources (e.g. "@string/
something") in our XML layouts. It should be available in the next
release.

Thanks,
-Tim

On Apr 30, 4:40 pm, William Ferguson <william.ferguson...@gmail.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
seb  
View profile  
 More options May 1 2011, 6:11 am
From: seb <genieuk2...@gmail.com>
Date: Sun, 1 May 2011 03:11:17 -0700 (PDT)
Local: Sun, May 1 2011 6:11 am
Subject: Re: Please allow adUnitId to be specified in strings.xml and/or MANIFEST
On May 1, 12:40 am, William Ferguson <william.ferguson...@gmail.com>
wrote:

William,

You are trying to get the adUnitId from the strings.xml, as I said
trying using the attrs.xml to define the tag, i.e.

attrs.xml file in the res/values directory as follows

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <declare-styleable name="com.google.ads.AdView">
      <attr name="adSize">
          <enum name="BANNER" value="1"/>
          <enum name="IAB_MRECT" value="2"/>
          <enum name="IAB_BANNER" value="3"/>
          <enum name="IAB_LEADERBOARD" value="4"/>
      </attr>
      <attr name="adUnitId" format="string"/>
  </declare-styleable>
</resources>

and then in your layout xml define your AdView, e.g.

<com.google.ads.AdView android:id="@+id/adView"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         ads:adUnitId="a111bbbccddd"
                         ads:adSize="BANNER"/>

The only thing is you'll have to enter the id in multiple places if
you have several AdViews.

One thing to note is that you need to declare the ads namespace in
your layout xml. i.e.

xmlns:ads="http://schemas.android.com/apk/res/
com.yourdomain.yourpackage"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
William Ferguson  
View profile  
 More options May 1 2011, 12:22 pm
From: William Ferguson <william.ferguson...@gmail.com>
Date: Sun, 1 May 2011 09:22:28 -0700 (PDT)
Local: Sun, May 1 2011 12:22 pm
Subject: Re: Please allow adUnitId to be specified in strings.xml and/or MANIFEST
Seb, please read Mark Carter's original post again.

He (as I do) wants to be able to specify the AdMobId in strings.xml
instead of in every layout. Ie

<com.google.ads.AdView android:id="@+id/adView"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         ads:adUnitId="@string/myAdmobId
                         ads:adSize="BANNER"/>

William

On May 1, 8:11 pm, seb <genieuk2...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
William Ferguson  
View profile  
 More options May 1 2011, 12:23 pm
From: William Ferguson <william.ferguson...@gmail.com>
Date: Sun, 1 May 2011 09:23:16 -0700 (PDT)
Local: Sun, May 1 2011 12:23 pm
Subject: Re: Please allow adUnitId to be specified in strings.xml and/or MANIFEST
Thanks Tim, that's good news.

On May 1, 9:47 am, Tim <timzwie...@google.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
seb  
View profile  
 More options May 1 2011, 1:24 pm
From: seb <genieuk2...@gmail.com>
Date: Sun, 1 May 2011 10:24:21 -0700 (PDT)
Local: Sun, May 1 2011 1:24 pm
Subject: Re: Please allow adUnitId to be specified in strings.xml and/or MANIFEST
Sorry, I've put my goggles on now, and see what he means. :-)

Agreed, it would be useful to have one place to define your id.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »