A library project is like having all the code in one project. There are a few things to keep track of associated with namespaces, but overall it works very well.
eg. Your library has its own namespace
Library package name = uk.co.lib Main application package name = uk.co.app
The actions in the library in which you want to access from the main application must be added to the application manifest. An activity named A in the library project will be added to the manifest in the main application, for example:
<activity android:name="uk.co.lib.A">
Access to general settings, etc. will give the same result from any namespace and return the settings for the application.
There is only one application, so there is only one ApplicationContext
Kuffs
source share