> Mark, do you know a good way to share a utility class between apps? I
> don't mind the code being duplicated in each app's APK, but I'm
> looking for a way to not have to maintain separate Java files for the
> same source.

Package it as a JAR. Here's the recipe I use for the CWAC components
(http://github.com/commonsguy):

Step #1: Create an empty Android project to hold the reusable code plus
some scrap activity for testing or whatever.

Step #2: Implement the code and stuff

Step #3: Add a "jar" task to the Ant build script to package up just the
real code but not the scrap activity (e.g., filter out stuff in the .demo
sub-package)

At that point, you have a JAR you can drop into other applications' libs/
directories (and, if you're an Eclipsian, add it to their build paths).

By using an Android project to hold your JAR development, you
automatically get access to the Android APIs to use from your common code.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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