Commit graph

342 commits

Author SHA1 Message Date
darcywong00
84ddf0c990 Add Firebase Crashlytics for crash reporting
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.
2018-02-14 19:37:21 +07:00
darcywong00
4d51b1a666 Address review comments
Refactor duplicate code in `useLocalKMP()`
2018-02-06 11:20:19 +07:00
darcywong00
f85ef3e3e4 Improve UX for KMP distribution
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.
2018-02-05 16:36:12 +07:00
darcywong00
913e58a60a Request storage permissions at runtime to install local KMP file
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
2018-02-02 08:28:15 +07:00
darcywong00
9211f66c36 Cleanup to address review comments 2018-01-31 10:57:33 +07:00
darcywong00
09e0f4aa98 Merge branch 'android-peer-distribution'
Conflicts:
	android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/MainActivity.java
2018-01-29 18:18:17 +07:00
darcywong00
61bf0410a8 Deprecate non-direct links for ad-hoc keyboards 2018-01-29 16:25:10 +07:00
darcywong00
9bc7b43493 Handle kmp files passed from Android DownloadManager
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.
2018-01-28 23:04:14 +07:00
darcywong00
e4c88ed09b Try to refine intent filters for file:// and content:// 2018-01-28 23:01:40 +07:00
darcywong00
a7fa26e472 Add Toast notification when File access to KMP denied 2018-01-28 23:01:12 +07:00
darcywong00
0afd5796ba Improve UI and check kmp for touch keyboards
- 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
-
2018-01-27 20:20:00 +07:00
darcywong00
0e220c6797 Begin addressing review issues
- clean up stray code from earlier development
- give some clear notifications to user when package install fails
2018-01-26 16:07:53 +07:00
darcywong00
35c43da0f3 Associate kmp with keyman app
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
2018-01-24 06:12:03 +07:00
darcywong00
40da15f44d Change check for welcome.htm to be case-insensitive 2018-01-23 13:16:29 +07:00
darcywong00
079376d9a6 Consolidate PackageActivity cleanup
Also removed unncessary storage permission
2018-01-23 09:13:08 +07:00
darcywong00
7e12f1a51c Force PackageActivity installs regardless of currently installed ver
Remove current package version so PackageActivity will always install the package.
2018-01-22 21:56:21 +07:00
darcywong00
67929b7c5f Clean up code 2018-01-22 19:10:37 +07:00
darcywong00
bac5acbe3f Use PackageActivity to install keyboard packages
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
2018-01-22 16:20:35 +07:00
darcywong00
a57de55348 Display Welcome.htm 2018-01-21 21:55:40 +07:00
darcywong00
5a795edb3f Download kmp in background
Use IntentService to download KMP in the background
2018-01-21 16:22:27 +07:00
darcywong00
0b5646c722 Handle font paths and change PackageActivity button style 2018-01-20 22:12:59 +07:00
darcywong00
9c2b44fff2 Tweak more PackageActivity layout 2018-01-19 13:28:02 +07:00
darcywong00
71101af915 Add more styling to package activity 2018-01-19 06:35:36 +07:00
darcywong00
2af337de62 Break out package processing to separate activity
This is a placeholder for kmp
2018-01-18 17:03:42 +07:00
Joshua A. Horton
8c223a10ed Basic KMP integration success - it still has some glitches, though. 2018-01-18 17:00:59 +07:00
darcywong00
3a0134a758 Handle undefined packageID as "cloud"
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
2018-01-17 16:08:46 +07:00
darcywong00
4787245808 Round 1 of adding feature for ad-hoc keyboard distribution via kmp 2018-01-17 10:58:25 +07:00
darcywong00
82f78f005c Document why removeKeyboardDownloadEventListeners are removed
Calls to `removeKEyboardDownloadEventListener()` are removed to ensure `onKeyboardDownloadFinished()` gets called
2017-12-15 10:24:40 +07:00
darcywong00
27629a578b Tweaks for keyboard update
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
2017-12-14 13:38:15 +07:00
darcywong00
4f5bd09cdb Tweak event handlers and fix processing custom JSON
For now, disable calls to `KMKeyboardDownloaderActivity.removeKEyboardDownloadEventListener()`. The parent activities will always pause when KMKeyboardDownloaderActivity runs, and we want the event handlers to trigger when the keyboards finish downloading.

Also fixed processing custom JSON to handle the JSONArray `languages`.
2017-12-13 12:47:36 +07:00
darcywong00
ebafec1626 Fix url key and isCustom() check 2017-12-13 05:57:49 +07:00
darcywong00
ba1a84dde6 Refactor keyboard download code
Currently in `KMManager`, there's 3 methods to download a `KMKeyboard` (2 in `KMKeyboardDownloader`, 1 in `KMCustomKeyboardDownloader`) for the 3 use-cases respectively:
1. Add new keyboard (from the cloud)
2. Update a keyboard
3. Install a custom keyboard

This PR refactors the following:
1. Code from `MainActivity.checkUrl()`, `KMManager.KMKeyboardDownloader()`, and  `KMManager.CustomKeyboardDownloader()` into a new activity `KMKeyboardDownloadActivity`. 
Code for doing actual file downloads are kept in an `AsyncTask`.
2. `FileDownloader` moved to a separate util class.
3. Confirmation dialogs for downloading keyboards are also refactored into `ConfirmDialogFragment`.
2017-12-13 05:14:45 +07:00
darcywong00
f6a710a383 Fix directory structure in MainActivity.onActivityResult
I suspect this portion of the code is obsolete, but fixed the old `/languages` and `/fonts` structure in this method.
2017-11-30 13:14:50 +07:00
darcywong00
4dd4379a64 "Add new keyboard" downloads to packages/cloud
At the moment, the keboard API isn't publishing the packageID, so using "cloud" as an in-term packageID.

As a result, keyboards get downloaded to /packages/cloud/
2017-11-29 14:49:21 +07:00
darcywong00
e46f6a9cc0 Start moving to new asset structure
By design, kmp keyboards will unzip into /packages/packageID folders. 

1. Moving default eurolatin2 keyboard assets
2. Move old keyboards to new packages structure
2017-11-28 14:48:56 +07:00
darcywong00
aaa1fc6788 Revert "Temporarily have 2 text fields in Keyman app"
This reverts commit a18bb2a2fd.
2017-09-12 09:49:26 +07:00
darcywong00
a18bb2a2fd Temporarily have 2 text fields in Keyman app
for testing that in-app keyboard resets when changing text area.

Do **not** merge this commit
2017-09-08 11:58:52 +07:00
darcywong00
ff080231dd Add resetContext to SystemKeyboard 2017-09-07 20:12:14 +07:00
darcywong00
2c93c9d20b Revert resume and pause code
cleanup back to original code
2017-08-28 16:14:54 +07:00
darcywong00
fe775e18f1 Hide keyboard when closing Keyman Browser 2017-08-23 14:12:55 +07:00
darcywong00
7d228e987e Remove Share to Facebook
Remove FacebookSDK from repo and associated logos
Ignore Facebook package names when generating intents to share
2017-08-15 09:29:17 +07:00
darcywong00
6d26d7cd9e Keyman for Android 2.8 Open Source
Copy over the Android source
Update build.sh scripts for new paths
KMEA/build.sh also updated to build KMW and use the artifacts
2017-07-21 11:52:22 +07:00