Document toolboxDocument toolbox

Android Room, Job Queue, and Cache Invalidation

This is documentation for the prototype that includes Room integration, Job Queue integration, and Cache Invalidation patterns.

Source documentation:

Git Repo w/ prototype:

State of Prototype

Prototype compiles and accurately reflects what I believe is the design pattern and API integration that accomplishes our goals. Unfortunately, I was unable to generify the components. App Config and Activities have very different API, call patterns, and query requirements. However, the pattern is simple enough that we should be able to replicate is across different use cases. If we need something generic and complete, we might want to consider codegen.

Code Organization

jobqueue package: Contains code to integrate with Android Priority Job Queue. BridgeJob is base class and handles retry logic and sets the Require Network flag. We also inject our managers here, so that Jobs can persist across app execution. We can either have the base class contain all the managers, or we can have different parent jobs for each manager and inject each parent class individually.

ActivityManagerV2: New version of ActivityManager using the new components. The old ActivityManager uses ScheduledActivityListV4 as its interface, which is hard to work with w.r.t Room persistence, so I created a brand new one.

persistence package: Contains code to integrate with Room and utils to marshal and unmarshal between Room type and Bridge Server type.