Adding a strings.xml overlay off of a packages res/value folder

2,313 views
Skip to first unread message

Gatesjunior

unread,
Dec 30, 2011, 1:29:22 PM12/30/11
to Android Building
I have tried until I am blue in the face. I can overlay pretty much
everything it seems without issue except the strings.xml file ??? It
says something about using <add-resource> ??? Huh ?? Can someone
give me some direction on what the proper way is to overlay a
strings.xml value I have added to an application ??

Thanks

Jean-Baptiste Queru

unread,
Jan 3, 2012, 11:18:07 AM1/3/12
to android-...@googlegroups.com
"find device -name strings.xml" will find a few examples.

JBQ

> --
> You received this message because you are subscribed to the "Android Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> android-buildi...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en

--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

Jesse Godsey

unread,
Jan 3, 2012, 11:19:25 AM1/3/12
to Android Building

Any idea to below ??  Also, can I overlay source java files without modifying the original ?

Magnus Bäck

unread,
Jan 3, 2012, 2:35:33 PM1/3/12
to Android Building
On Tuesday, January 03, 2012 at 17:19 CET,
Jesse Godsey <jesse...@gmail.com> wrote:

> Also, can I overlay source java files without modifying the original ?

No, the overlay system only works on files read by the resource
compiler (aapt). Besides, you don't want to overlay Java source
files anyway. Source control systems like Git were invented for
that purpose.

--
Magnus B�ck Opinions are my own and do not necessarily
SW Configuration Manager represent the ones of my employer, etc.
Sony Ericsson

Mike

unread,
Feb 24, 2012, 6:40:49 PM2/24/12
to Android Building
I apologize in advance - but I'm missing something with your clue to
"find device-name strings.xml". (sorry)

I have modified the strings.xml file and cannot build android and
receive the following error;

*** No rule to Make target 'framework/base/core/res/res/values/
strings', needed by 'out/target/common/obj/APPS/framework-
res_intermediates/src/R.stamp'. Stop.


If you could PLEASE take a moment to shine a light into my darkness!
Many Thanks


On Jan 3, 10:18 am, Jean-Baptiste Queru <j...@android.com> wrote:
> "find device -namestrings.xml" will find a few examples.
>
> JBQ
>
>
>
>
>
>
>
>
>
> On Fri, Dec 30, 2011 at 10:29 AM, Gatesjunior <jessegod...@gmail.com> wrote:
> > I have tried until I am blue in the face.  I can overlay pretty much
> > everything it seems without issue except thestrings.xml file ???  It

Magnus Bäck

unread,
Feb 24, 2012, 7:23:20 PM2/24/12
to Android Building
On Friday, February 24, 2012 at 18:40 EST,
Mike <m...@guisys.com> wrote:

> I apologize in advance - but I'm missing something with your clue to
> "find device-name strings.xml". (sorry)

That's "find device -name strings.xml". I'd expect that
command to reveal a couple of device overlay files where
string are being overlaid.

> I have modified the strings.xml file and cannot build android and
> receive the following error;
>
> *** No rule to Make target 'framework/base/core/res/res/values/
> strings', needed by 'out/target/common/obj/APPS/framework-
> res_intermediates/src/R.stamp'. Stop.

Sorry, but that doesn't make any sense if you indeed only
added/changed/deleted a few lines in strings.xml. Please
make sure you haven't inadvertently made other changes
to your workspace.

> > > I have tried until I am blue in the face. �I can overlay pretty
> > > much everything it seems without issue except thestrings.xml file
> > > ??? �It says something about using <add-resource> ??? �Huh ?? �Can
> > > someone give me some direction on what the proper way is to
> > > overlay a strings.xml value I have added to an application ??

If you in an overlay add string resources rather than modify
existing ones you need to declare them with <add-resource>.
See http://goo.gl/OEygO for details.

--
Magnus B�ck
ba...@google.com

Mike

unread,
Feb 27, 2012, 6:12:22 PM2/27/12
to Android Building
Magnus,

Thank you for your reply. On your comment that it shouldn't matter
and that perhaps something else had changed.
Nothing had changed - however I had left a bkup copy of strings.xml in
the folder and that was the root of the build failure.

...duh! Apologize for my stooooopidity. My nose was jammed to
deeply into the bark that I couldn't see the tree!

thanks again for your prompt and link (which will be useful for future
tweaking!),
mike

On Feb 24, 6:23 pm, Magnus Bäck <ba...@google.com> wrote:
> On Friday, February 24, 2012 at 18:40 EST,
>      Mike <m...@guisys.com> wrote:
>
> > I apologize in advance - but I'm missing something with your clue to
> > "find device-namestrings.xml".  (sorry)
>
> That's "find device -namestrings.xml". I'd expect that
> command to reveal a couple of device overlay files where
> string are being overlaid.
>
> > I have modified thestrings.xml file and cannot build android and
> > receive the following error;
>
> > *** No rule to Make target 'framework/base/core/res/res/values/
> >strings', needed by 'out/target/common/obj/APPS/framework-
> > res_intermediates/src/R.stamp'.  Stop.
>
> Sorry, but that doesn't make any sense if you indeed only
> added/changed/deleted a few lines instrings.xml. Please
> make sure you haven't inadvertently made other changes
> to your workspace.
>
> > > > I have tried until I am blue in the face. I can overlay pretty
> > > > much everything it seems without issue except thestrings.xml file
> > > > ??? It says something about using <add-resource> ??? Huh ?? Can
> > > > someone give me some direction on what the proper way is to
> > > > overlay astrings.xml value I have added to an application ??
>
> If you in an overlay add string resources rather than modify
> existing ones you need to declare them with <add-resource>.
> Seehttp://goo.gl/OEygOfor details.

Jean-Baptiste Queru

unread,
Mar 25, 2013, 10:23:36 AM3/25/13
to android-...@googlegroups.com
If you want to add values that can be used with lunch, they're set
from AndroidProducts.mk, scattered throughout the source tree.

If you then want such values to have a number in the lunch menu,
that's done with add_lunch_combo, typically from vendorsetup.sh
scattered throughout the source tree.

JBQ

On Sat, Mar 23, 2013 at 3:32 PM, Justin Buser <jus...@justinbuser.com> wrote:
> So I'm trying to overlay iOS 7 (dirty diaper) on top of my AOSP build (so
> that it looks reel purty) but no matter how differently I think I just can't
> seem to make it happen... Since it seems that reason and logic are my only
> options I'm wondering if there's a way to use resource overlays outside of
> the device/framework trees... I'm playing around with some various ways to
> add theme capabilities system wide, and I'd like to be able to use custom
> lunch targets, but I don't really feel like the device tree is an
> appropriate place to set stuff up. I'm of the opinion that at some point the
> rising popularity of Android combined with the increasing affordability of
> hardware will end up spawning a vast multitude of custom devices / ROMs /
> etc... If this indeed happens, then at some point the UI/aesthetic will
> components will need to be more easily isolated from their device/hardware
> counterparts. As such, and still being relatively new to the AOSP, I'm
> looking for a way to make a contribution while learning without spending an
> inordinate amount of time worrying about version control etc... Essentially
> I want to be able to finger paint for awhile without getting any on the
> walls so to speak.
>
> So, is there any easy way (using the vendor tree for instance) to quickly
> add lunch targets without adding / altering devices? Ideally I'd like to be
> able to give people the ability to choose a variety of options based on the
> same set of components, while maintaining the same core Android
> functionality but without restricting them to specific devices. It would be
> nice to be able to override resources throughout the system for testing
> purposes, but I wouldn't necessarily be looking to commit many of them so
> separation would be ideal.
>
> Keep in mind that when I ask "if there's a way" I obviously already know
> that there indeed is, what I'm looking for is some feedback / insight and
> any recommendations (even if they are simply to not waste my time for
> whatever reason).
>
> P.S. I apologize if this seems impossibly vague, I've only got a few hours a
> day to play around with this stuff and the concept itself hasn't fully
> matured in my mind yet so just think of this as brainstorming.
>
> --
> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> android-buildi...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Building" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-buildi...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Jean-Baptiste M. "JBQ" Queru
Technical Lead, Android Open Source Project, Google.

Justin Buser

unread,
Mar 26, 2013, 6:21:40 PM3/26/13
to android-...@googlegroups.com
No kidding? I'll definitely have to experiment tonight when I get home, thanks for the tip.  So does this mean that I can essentially create a separate directory tree, (let's say I start it with something like themes or styles) and add / overlay stuff in the same way that it's done via the device tree? If not what would the best place to initiate the make file scan of that directory be (obviously so it's called at an appropriate stage in the build process) ?


You received this message because you are subscribed to a topic in the Google Groups "Android Building" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-building/RlaTfhi-dds/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to android-buildi...@googlegroups.com.

Jean-Baptiste Queru

unread,
Mar 26, 2013, 6:43:33 PM3/26/13
to android-...@googlegroups.com
On the overlay front, you can have an overlay directory anywhere you want it.

So, you could have (following some existing naming conventions for convenience)

vendor/justinbuser/theming/AndroidProducts.mk
vendor/justinbuser/theming/dd.mk
vendor/justinbuser/overlays/dd/frameworks/base/<...>/strings.xml

Where AndroidProducts.mk contains:
PRODUCT_MAKEFILES := vendor/justinbuser/theming/dd.mk

And dd.mk contains:
PRODUCT_PACKAGE_OVERLAYS := vendor/justinbuser/overlays/dd
$(call inherit-product, $(SRC_TARGET_DIR)/product/full.mk)
PRODUCT_NAME := dd_emulator

And once you have that you can lunch dd_emulator-eng, make, and run
the emulator.

JBQ
Reply all
Reply to author
Forward
0 new messages