I have been successful breaking out common classes into separate
Eclipse projects and exporting them as .jar files, and referencing
the .jar files in other Eclipse projects, as long as they do not
reference resources. If they need to reference resources, well, it
just seems it is not possible at this point. For the parts of the
Android code that reference resources I am pretty much just copy/
pasting between projects.

On Dec 10, 8:00 am, Andriy Tsykholyas <[email protected]>
wrote:
> Hi,
>
> * In short:
> Is it possible to reuse classes and resources from A.apk in B.apk?
>
> * Explanation and my problem:
> I have project A with some classes and some resources (used for
> classes configuration). I'd like to reuse its classes (and resources
> necessary for them) in another project B (and possibly in more
> projects). Currently I have 2 projects in Eclipse and they both builds
> fine, but when project B is started in emulator it fails with error:
> "Could not find method project.a.ClassA.methodA, referenced form
> method project.b.ClassB.methodB"
>
> I've found those 3 
> discussions:http://groups.google.com/group/android-developers/browse_thread/threa...http://groups.google.com/group/android-developers/browse_thread/threa...http://groups.google.com/group/android-developers/browse_thread/threa...
> and it looks like there are only 3 options:
> 1) Highly complicated custom build file. It should get classes and
> resources from both projects and package them together.
> 2) Make a third project which consists of symbolic links to classes
> and resources of those two projects.
> 3) Make project A as a service and consume it in project B.
> They all are imperfect:
> - 1 and 2 would pack classes and resources of project A into the .apk
> of project B.
> - 3 has performance penalty and reuse is not so easy.
>
> So, is there any simpler/better solution? :)
>
> best regards
>
> Andriy

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to