All Stories
General This post describes how to use Android ContentProvider to allow automatic system initialisation for your library, therefore help make your library easier to integrate and control its flow. While this article mostly demonstrates one use case, you can use the idea in other cases as well. What is it all about? Always Strive To Simplify Integration Let’s assume you are writing code for a software library that would be used by an Android application. Most common flows require the app using your library to manually call the initialisation of your library and usually, provide it with their own Context. This will require your client to write a code along these lines: This article suggests using a Content Provider to allow: Completely autonomous initialisation, liberating you from having to ask the client for init at all. Avoiding the necessity of asking your client for their Application Context. […]