ericcornelissen / NervousFish

An app for your :iphone: to exchange public-keys in a secure manner.
GNU Lesser General Public License v3.0
2 stars 4 forks source link

Fix the file not found error in the database #96

Closed ericcornelissen closed 7 years ago

ericcornelissen commented 7 years ago

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

  1. We need a working database.
  2. 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.

Alternative implementation

Non.

Notes

n/a