It seems to me that approach 2 (Make a third project which consists of symbolic links to classes and resources of those two projects) is simplest. So, I'm proceeding with it :)
On Dec 10, 3:58 pm, WoodManEXP <[email protected]> wrote: > Yes I would like to avoid the copy/pasting as well! > > Other Java environs, eg NetBeans, have a concept of embedding > resources in .jar files (that are needed by the jar file). Apparently > the Google team has not has time to implement such a thing for Android > world. They have this technique to generating the R. constants, which > need to be unique within the app, and there is not a way of ensuring > uniqueness if they were in separate .jar files. I believe the "package" attribute in the manifest file might be used as name space part to make resources unique :) > The current R. technique is OK if app are little discrete things. But > with the inevitable increase in complexity of these Android apps there > is the need to break apart the apps into reusable modules (.jar > files). And resources need to be included in the mix. You've just precisely described my situation :) > (In days of old there were tools called Link Editors that resolved > such issues :-) ) > > On Dec 10, 8:42 am, Andriy Tsykholyas <[email protected]> > wrote: > > > On Dec 10, 3:28 pm, WoodManEXP <[email protected]> wrote:> If they need > > to reference resources, well, it > > > just seems it is not possible at this point. > > > That's what I was afraid of :( > > > > For the parts of the > > > Android code that reference resources I am pretty much just copy/ > > > pasting between projects. > > > I'd like to avoid such solution :) > > > > 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...... > > > > 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

