Android library on build system

364 views
Skip to first unread message

Anders Widen

unread,
Dec 3, 2010, 11:11:07 AM12/3/10
to android-porting
We're developing a group of applications and want to reuse resources
(drawables, styles, colors...) in all of these apps to have a
consistent and modifiable system.

Is there a way to have an "Android Project Library" of resources that
are not shared on the platform but built into each app seperatly (into
the apk) by the android build system? If it can be done by the ADT
plug-in it should be able to be done by the build system?

http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject

How would the Android.mk file look for the app and the library?
Could you use LOCAL_JAVA_RESOURCE_DIRS ?


I looked into public and internal resources and concluded that these
will break compability when upgrading the platform (if not rebuilding
all the apps again and shipping them with the upgrade).

//Anders

Ying Wang

unread,
Dec 3, 2010, 2:09:46 PM12/3/10
to ande...@gmail.com, android-porting
It's quite easy with the android platform build system.
Suppose you have the following directory structure:
project/
project/res/
project/app1/..
project/app2/..
...

Then in project/app1/Android.mk add this:
LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/../res

Anders Widen

unread,
Dec 6, 2010, 4:54:52 AM12/6/10
to android-porting
I need to have some shared resources and some app specific:
Compiling should combine both resource paths.

project/
project/sharedresources/res
project/app1/res
project/app2/res

I tried a lot of combinations of things in the .mk file but they all
gave errors when trying to build.
Any ideas?



On 3 Dec, 20:09, Ying Wang <wangy...@android.com> wrote:
> It's quite easy with the android platform build system.
> Suppose you have the following directory structure:
> project/
> project/res/
> project/app1/..
> project/app2/..
> ...
>
> Then in project/app1/Android.mk add this:
> LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/../res
>
> On Fri, Dec 3, 2010 at 8:11 AM, Anders Widen <anders...@gmail.com> wrote:
> > We're developing a group of applications and want to reuse resources
> > (drawables, styles, colors...) in all of these apps to have a
> > consistent and modifiable system.
>
> > Is there a way to have an "Android Project Library" of resources that
> > are not shared on the platform but built into each app seperatly (into
> > the apk) by the android build system? If it can be done by the ADT
> > plug-in it should be able to be done by the build system?
>
> >http://developer.android.com/guide/developing/eclipse-adt.html#librar...
>
> > How would the Android.mk file look for the app and the library?
> > Could you use LOCAL_JAVA_RESOURCE_DIRS ?
>
> > I looked into public and internal resources and concluded that these
> > will break compability when upgrading the platform (if not rebuilding
> > all the apps again and shipping them with the upgrade).
>
> > //Anders
>
> > --
> > unsubscribe: android-porti...@googlegroups.com<android-porting%2Bunsu...@googlegroups.com>
> > website:http://groups.google.com/group/android-porting

Ying Wang

unread,
Dec 6, 2010, 2:15:29 PM12/6/10
to ande...@gmail.com, android-porting
Try something like:
LOCAL_RESOURCE_DIR := project/sharedresources/res project/app1/res $(LOCAL_RESOURCE_DIR)
If it fails again, please paste the error message here.

Reply all
Reply to author
Forward
0 new messages