You are on page 1of 2

MVC Design

Splash retrieve usage information from backendts Main


n
e
v
e
before starting sage
Activity
Activity
u
ba
n
i
run

to
d
n
u
o
ckgr

Usage
Service

Today
Fragment

update UI

Usage
RX

pt
e
c
r
inte

Week
Fragment

get current usage for chart


update daily duration

Shared
Preferences

Settings
Fragment

set user preferences

get usage entries for charts

store entry locally

Lock/
Unlock
Entry

store usage entry at midnight

Usage
Entry

Threads on Threads
get statistics from last week
to calculate desired limits

Shared
Preferences
Daily Unlocks
Daily Duration
Desired Limit

SQLite
Database

Parse
Backend

Timestamp
Unlock Count
Total Duration
update data Desired Limit
locally
Percentile

store data
in the cloud

main thread

Usage
RX
Usage
Service

pending intent

Midnight
Scheduler

Timestamp
Duration
Unlocks