The Android library projects are a bit particular in the sense that the main
project doesn't actually reference the library projects in a way that JDT
(the Java plug-in for eclipse) recognize.

This means that the main project doesn't know about the project referenced
by the library projects. It's the same issue with jar files. If you add a
jar file to the library project, you have to manually add it to the main
project.

The solution is to make the "game project" reference the "engine" project,
the same way "EngineAndroidLib" references it.

Xav

On Mon, Feb 7, 2011 at 3:12 PM, Matthias Stock <[email protected]> wrote:

> Hello,
>
> this is Eclipse related (Helios). The basic question here is:
> How would you include system independent java classes into a Android
> Library project?
>
> Context: I have a graphics engine which is loosely coupled with the
> Android system (engine classes do not include Android packages, mostly
> factory patterns). I'd like being able to write e.g. an editor for the
> Windows JRE which includes this engine also.
>
> This is my preferred projects setup:
>
> #Project 'Engine'
> - Java project
> - does not have any system specific classes
>
> #Project 'EngineAndroidLib'
> - Android library project
> - includes 'Engine' *Point of Failure*
> - only Android specific classes
> - keeps default assets
>
> #Project 'EngineWindows'
> - Java project
> - includes JOGL
> - includes 'Engine'
> - only windows specific classes
> - keeps default assets
>
> #Project 'Game'
> - Android project
> - includes 'EngineAndroidLib' library
>
> #Project 'Editor
> - Java project
> - uses swing
> - includes 'EngineWindows'
>
> My problem is that the Android library 'EngineAndroidLib' itself
> includes the source files of the 'Engine' project. This leads to an
> error within my 'Game' project (added library dependency in Properties-
> >Android):
> "The import [of 'Engine' packages] cannot be resolved."
> Maybe 'Game' includes the lib without considering lib's includes.
>
> Do you have a fix for that?
> - or -
> Do you have another idea on how to include (system independent) java
> classes into an Android Library project?
>
> Thanks for reading. I wasn't able to make it short... Hopefully, I
> made it clear at least. Btw.: This is for a bachelor thesis, no
> commercial stuff.
>
> Best regards,
> Matthias
>
> --
> 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
>



-- 
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

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