views:

43

answers:

1

How can I reuse code AND resources in several applications? I have a fairly large code base (including resources) that I want to reuse i several applications. How can I do that?

I did try to use the Android Library concept (http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject) but never got it to work in Android 1.x

I'm amazed by the lack of information on the subject. It seems like Google has aimed Android development at pet projects and not real development. Variant handling should have been solved ages ago.

+2  A: 

I've faced this issue. Android doesn't really lend itself to 'template' style development because the frameworks are relatively immature and the nature of the development is so wide ranging, however, these are some steps I've taken:

  • Create a library of common resources - I have generic XML files ready to go that support things like checkbox lists, context menus and dialogs.
  • Create some generic APIs for things like service bindings
  • Wrap common functionality into components - I've written my own location wrapper for example.

Note: I assume you mean reuse outside of SCM.

flesh