7

I want to make an Android library which contains drawable resource files. But I wonder if the library's resource IDs might conflict with the application resouce IDs. Is it possible to make such a library?

2
  • 2
    Create a .Jar file and use it as resource :) Commented Aug 27, 2012 at 3:21
  • @Lucifer if the question is about .jar files, then the answer is no: stackoverflow.com/questions/2474904/… However, if the question is about Android Library Projects the answer is yes as in dtmilano's answer. Commented Aug 27, 2012 at 5:26

1 Answer 1

8

This is exactly the main idea behing Android Library Projects, to share code and resources among projects.

An Android library project is a development project that holds shared Android source code and resources. Other Android application projects can reference the library project and, at build time, include its compiled sources in their .apk files. Multiple application projects can reference the same library project and any single application project can reference multiple library projects.

See the details at Library Projects

Sign up to request clarification or add additional context in comments.

1 Comment

Just want to add to this answer, if you declare resources in your library and want to use them in library code elsewhere, don't forget to declare package field in your library's manifest file, otherwise you won't be able to do it.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.