This handles all transitions where an external app/dialog using the system OSK returns to the Keyman app such as resuming:
* from WebBrowserActivity
* from Android Oreo's "Add to dictionary" dialog
This is a follow-on to #220 that fixed 2 OSK that were appearing when exiting WebBrowserActivity.
* If navigation is possible, backButton navigates back.
* Hide the system OSK so returning to Keyman app won't have 2 keyboards visible
Also ignore build_file_checksums file that Android Gradle 3.1 generates.
Consumers of KMEA need to include Firebase and Crashlytics dependencies, but don't need to run the Google services. This simplifies these projects of not neeeding google-services.json.
Also added `-no-daemon` and `-debug` options to Samples and Test `build.sh` scripts so they can be run on CI servers.
Originally, the kMAPro/src/Release folder was intended for the CI server to copy the google-services.json file, but that won't be where it gets placed now.
Using Crashlytics for crash reporting.
Trying Firebase and Crashlytics.Answers for logging events (like km_add_keyboard) for analytics
Firebase events don't persist between app launches
While legacy stable kmapro releases have analytics on the Google Play Console, Google recommends [Firebase Crashlytics](https://firebase.google.com/docs/crash/) for crash reporting.
This requires a `google-services.json` file for gradle builds. A sanitized version intended for developers/Debug variant is checked into the repo, and is associated with an appliction ID `com.tavultesoft.kmapro.debug`. The one for `com.tavultesoft.kmapro` releaeses will go on the CI servers.
Breaking change: Consuming apps of KMEA will be responsible for including the Firebase dependencies. At the moment, only kmapro has been updated.
TBD: Registering KMSamples and the Test Harness with Firebase for their own `google.services.json` file.
- Log addKeyboard as an analytic event
- Update kmapro build.sh script to allow debug-only variant
- Add info to history.md and README.md
- Add Gradle setting so CI server can use production `google-services.json` file
- Temporarily add a menu button to force a crash. This is engineering code that will be removed once analytics in a Release build is confirmed.
For keyboards installed via keyboard packages, use the welcome.htm if it exists for keyboard information
- Update PackageProcessorTest to include CustomHelpLink info
- Renamed Welcome.htm to welcome.htm in test_resources/**/gff_amh_7_test_json.kmp.
Due to Android's limited set of regex characters for intent actions, any local `.kmp*` file triggers the Keyman app. (e.g. `.kmp` is treated the same as `.kmpo`). Added Toast notifications for when the intent inadvertently triggers the Keyman app.
Also updated PackageActivity to display the package name when no `welcome.htm` file exists.
A Linux user reports issues building KMAPro because the script uses bash syntax instead of sh.
```
while [[ $# -gt 0 ]] ; do
```
KMEA is already using `#!/bin/bash`
Starting with Android 6.0 Marshmallow (API 23), apps need to request permissions for "dangerous" (Storage) access at runtime. Previous versions of Android granted permissions at installation. Normal permissions declared in the manifest are granted automatically.
This doesn't affect Keyman running on older versions of Android
[Reference](https://developer.android.com/training/permissions/requesting.html)
[Runtime Permissions Sample](https://github.com/googlesamples/android-RuntimePermissions) provided by Google
Intents from the DownloadManager use paths like `/document/number/` so additional code needed to determine the kmp filename.
protocols also separated in switch statement for maintainability.
- Changed PackageProcessor to skip processing keyboard ID's if JS not found
- Fix a PackageProcessorTest to use the correct package ID
- Added a dialog for when Packge install fails
-
Add intent-filter and storage permissions so Keyman app will process keyman://, http://, https:// protocols, along with local KMP file. Also add external storage permission
Update MainActivity to pass the downloaded kmp file to PackageActivity.
PackageActivity then unzips and parses the package version, and displays the Welcome page with the package version. If Welcome.htm is not in the package, just display the package ID.
Lastly, copied package processing code from KMKeyboardDownloaderActivity to PackageActivity.
TODO: cleanup KMKeyboardDownloaderActivity
Per design discussions, use "cloud" as the package ID when it's undefined. Those keyboards get stored physically at `/cloud/`.
Later on, keyboards installed via kmp will be installed at `/packages/packageID/`
Also update version checker depending on package ID:
1. cloud: use the version string within the filename
2. all others: parse kmp.json for the keyboard version
Include language name and keyboard name when updating keyboard version. Dismiss the updateProgress dialog when keyboard has finished downloading.
Also fixed a typo in comment