DivXZero
DivXZero

Reputation: 611

How would you write a library to be used on android?

I've already written a game engine in java using eclipse and opengl es, I had one project (an android project) which contained both of my packages

com.logic.engine
com.logic.testapp

I wanted a way to keep my engine and test app seperate, I've made an earlier post about how this is done, and I figured out how to reference one project in the build path of another (or just creating a jar file).

My problem is that, lets say I now have my engine all wrapped up in an android project com.logic.engine, and now someone would like to use this engine to create a game, so they create an android project com.someclient.game, well now because we have one android project referencing another, it crashes everytime.

Now obviously i need the android sdk in my engine package in order to reference things, but its also required on the client app, since the activity is what is actually being run by android.

I guess my question is, how can i create a project for my game engine without it being an android project, but still referencing the android sdk, and without causing it to crash the client app using it?

edit:

note: the client app utilizes the engine flawlessly when its in the same project folder, it isn't until the engine is referenced from another project containing the android sdk that it crashes, so im 99.9% positive it has nothing to do with my code

Upvotes: 1

Views: 1528

Answers (3)

dave
dave

Reputation: 1430

Just a fix for the two links above that no longer work

Android Library Project

Example Library Tut

Upvotes: 0

Cheryl Simon
Cheryl Simon

Reputation: 46844

Your game engine project should be an Android library project. See Working with library projects.

Upvotes: 1

CommonsWare
CommonsWare

Reputation: 1006664

Use an Android library project.

Upvotes: 0

Related Questions