In Android if you use a library in your app (such as the Support Library) the code for the library is duplicated on the device for each app that uses it.
Why can’t android use the linux “shared library” concept, so each app wouldn’t have to duplicate the library’s code?
1
This is largely due to the security model. On Android, each application runs in its own silo. This is completely different to a desktop OS, where all applications have full access to all the user’s data.
If we have two applications, A and B, that both use a shared library. If they used the same copy, then potentially application A could break into application B’s silo – which is not desired.
As paulkayuk comments, this is also to avoid DLL Hell – problems caused by applications expecting different versions of a shared library. These days storage is cheap – even on mobile – so avoiding DLL Hell is more important than saving a bit of storage space.
8
Android does have a facility for sharing libraries, but it is a little cumbersome to use so seems to be rarely used in practice. Applications that use Google Play Services, for instance, use this model.
The support library, however, specifically does not use this facility because it is expected that applications may be closely tied to a specific version of it, and the shared library system only allows a single version to be installed at a time.