In native development, you can produce libraries – .so, .dll etc – that other libraries and programs can share.
In Java, you can put your code in a JAR in the classpath and other programs and libraries can use it.
So how can you do modular programs in Android? I get the impression from the documentation that each APK is a self-contained island. Can different APKs share code?
And how does installation work when you have these external dependencies? Can you specify that you rely on library that is not in your APK and get it installed too?
If you can’t have ‘dynamic linking’, can you have ‘static linking’ by developing your shared code and somehow putting the equiv of a JAR into each APK that requires it?
Regarding static linking, you can share code amongst Android applications using .jar files in the standard Java manner. However you can’t currently use the Android resource system (content under the ‘res’ directory, and the ‘R’ class) which hamstrings the idea of control libraries somewhat. It also makes using localizable strings impossible, and you can’t have Application or Service definitions, or anything else declared in AndroidManifest.xml.
Regarding dynamic linking, there is a kind of library that is distributed in the Market as an .apk itself, and included dynamically at runtime. Many developers are loath to ask their users to install two .apks. This approach does cause user confusion.