Export/Import all notes to/from a single JSON file #161
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem Description
A pain point for some users may be that exporting and importing notes can take quite a lot of time if they have on the order of 1000's of notes (for me it takes ~20mins).
Diagnosis and Proposed Solution
I ran export in an emulator with profiling and found that creating many files was causing the performance issues. I first tried using a snapshot as recommended by FSAF which is already supposed to be an improvement on the native android framework, but it made little difference. So I decided to try and make export and import work with just a single JSON file. This made export/import almost instant.
What's Missing
I haven't added translations for any language beside English.
Issues Out of Scope For Consideration
NotepadActivity.onActivityResult
. If parsing fails the app crashes without any description of what happened.onComplete
for theArtVandeley
functions will finish running before the coroutines finish successfully or unsuccessfully.artVandelay.importNotes
will run theonComplete
which notifies users that the import of notes was successful before it has actually finished successfully (maybe the toast can be moved inside the coroutine or we can chain coroutines, but I'm not sure)