Add ability to share backup file via Android native sharing to make it easier to access #829
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.
This adds the ability to share the database backup file via the native Android sharing widget. This should address the problems people are having to access the backup file, in particular on newer versions of Android.
The implementation is based on the SocialSharing-PhoneGap-Plugin. The plugin is a bit old and no longer maintained, but I tested it on both Android 12 and Android 14, and it appears to work fine. However, to make it work I had to apply some patches to the plugin (with npm-patch). The only way I found to ensure these patches are applied when installing the plugin is this:
npm install
. This installs the plugin in the node_modules folder and applies the patches.cordova platform rm android
. This temporarily removes the android platform.cordova platform add android@12.0.1
. This adds the android platform back with the patched plugin.This PR adds two new buttons in Import/Export settings, one for sharing a database backup and one for sharing a diary csv export. When you press on one of the buttons, it first creates a file in the usual location (Documents folder on Android 12 and below, Waistline app data folder on Android 13 and above). It then opens the native Android sharing widget which allows you to share the file with another app, e.g. send it to yourself via email or upload it into the cloud.
Closes #828
Closes #798
Closes #745
Closes #744
Closes #742
Closes #553
Closes #658
Closes #430