Re: [android-building] Building system apps as part of the AOSP takes wrong resources

308 views
Skip to first unread message

Magnus Bäck

unread,
May 22, 2013, 10:47:23 AM5/22/13
to android-...@googlegroups.com
On Wednesday, May 22, 2013 at 08:24 EDT,
android...@gmail.com wrote:

> I've just encountered a strange behaviour in AOSP compilation toolchain.
> When I compile my app as part of the AOSP (in packages/apps/ ), and then
> open the emulator and run it, it always takes resources out of the mdpi
> folder even though I compiled the emulator with a 320 screen density
> (hw.lcd.density = 320).
> However, if I compile the same app with eclipse and install it on that
> same emulator, resources are taken from xhdpi as they should.
> What could be causing this?

When you build with Eclipse all resources are included because the
APK is device-agnostic, but when you build it with make it's device
specific and only includes resources for the target product. Previously
this was done by adding e.g. xhdpi to PRODUCT_LOCALES of a suitable
product config file (perhaps build/target/product/full_base.mk or
generic.mk would be suitable in this case), but nowadays it seems
PRODUCT_AAPT_CONFIG is the correct place. See example in
build/target/product/mini.mk.

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

Jean-Baptiste Queru

unread,
May 22, 2013, 10:55:50 AM5/22/13
to android-...@googlegroups.com
When building a system image, the assumption is that the apps will run on a single device, and (in order to save space and bandwidth) only the resources necessary for that specific device are included.

When building a standalone app, the assumption is that the app will run on all devices, and all the resources need to be included.

I don't remember and can't find off-hand where the emulator is set to mdpi. It's possible that this is the only default value, for legacy reasons (it was the only on in 1.5 and older versions).

JBQ

On Wed, May 22, 2013 at 5:24 AM, <android...@gmail.com> wrote:
Hi,

I've just encountered a strange behaviour in AOSP compilation toolchain.
When I compile my app as part of the AOSP (in packages/apps/ ), and then open the emulator and run it, it always takes resources out of the mdpi folder even though I compiled the emulator with a 320 screen density (hw.lcd.density = 320).
However, if I compile the same app with eclipse and install it on that same emulator, resources are taken from xhdpi as they should.
What could be causing this?

Thanks,

--
--
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.

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.

Magnus Bäck

unread,
May 22, 2013, 11:11:40 AM5/22/13
to android-...@googlegroups.com
On Wednesday, May 22, 2013 at 10:55 EDT,
Jean-Baptiste Queru <j...@android.com> wrote:

> When building a system image, the assumption is that the apps will run
> on a single device, and (in order to save space and bandwidth) only
> the resources necessary for that specific device are included.
>
> When building a standalone app, the assumption is that the app will
> run on all devices, and all the resources need to be included.
>
> I don't remember and can't find off-hand where the emulator is set to
> mdpi. It's possible that this is the only default value, for legacy
> reasons (it was the only on in 1.5 and older versions).

The mdpi (and nodpi) default is set in build/core/product_config.mk.
Of the standard devices in build/target/product only mini.mk touches
this configuration.

--
Magnus Bäck
ba...@google.com
Reply all
Reply to author
Forward
0 new messages