This is the successor PR of #86 (as mentioned in this review). It is a better solution to the original problem, and an actual working problem to a similar issue introduced in #90. It fixes the issue that the database can't read (or write for that matter) to the local database file.
Why
We need a working database.
The previous solution relied on a getter for a non-final and not-by-default initialized variable (so it could be null)
How
The EntryActivity now tells the ServiceLocator what the path is where the app is allowed to store files. And the Constants class will ask the ServiceLocator for this value (where the ServiceLocator will perform a check during runtime if it is not null).
You can check for yourself if this works by opening the app and seeing if a stacktrace is printed from the GsonDatabaseAdapter class.
Relevant Issues: -
Related Pull Requests: #86, #90
What
This is the successor PR of #86 (as mentioned in this review). It is a better solution to the original problem, and an actual working problem to a similar issue introduced in #90. It fixes the issue that the database can't read (or write for that matter) to the local database file.
Why
final
and not-by-default initialized variable (so it could benull
)How
The
EntryActivity
now tells theServiceLocator
what the path is where the app is allowed to store files. And theConstants
class will ask theServiceLocator
for this value (where theServiceLocator
will perform a check during runtime if it is notnull
).You can check for yourself if this works by opening the app and seeing if a stacktrace is printed from the
GsonDatabaseAdapter
class.Alternative implementation
Non.
Notes
n/a