-
Notifications
You must be signed in to change notification settings - Fork 2
Development
This app was developed using dart, the flutter framework and Tensorflow (lite).
The Machine Learning project can be found here.
Flutter needs to be installed. For this please follow the guide on the official website.
Now the repository of DaKanji needs to be cloned:
git clone https://github.com/CaptainDario/DaKanji-Mobile
Than all necessary packages need to be installed:
flutter pub get
This is a (hopefully) complete table of features which need platform dependent implementations and if they are currently implemented.
Android | iOS | Linux | MacOS | Web | Windows | |
---|---|---|---|---|---|---|
rate app in store | X | X ️ | O | O | O | O |
deep linking | X | X | O | O | O | O |
app dictionaries | X | X | O | O | O | O |
OS browser for dict | X | X | O | O | O | X |
WebView | X | X | W | W | W | W |
Single Kanji CNN | X | X ️ | O | O | W | X |
use system theme | X | X ️ | O | O | O | W |
Legend: X - done | W - waiting for plugin / flutter | O - not started
PR's for new languages or updates to existing ones are always welcome.
To manage localizations you can use i18n manager.
First add a .json
-file with your language code (ex.: russian -> ru.json
).
Than open the localization folder (assets\translations
) with i18n manager and fill all the necessary fields.
Finally open a PR and your language will be included in the next release of DaKanji.
Important things to know:
While adding a translation a few things regarding syntax are important to know.
syntax | meaning |
---|---|
@:link | Link to a different i18n translation element Ex.: @:dark will be replaced by the translation of the dark element. |
[text which users sees](url) | A link where the part in [] is the text the users sees. And () is the url which the user will be redirected when clicking on it. |
WORDS_IN_CAPS_WITH_UNDERSCORE | Those are variables which will be replaced by a value at runtime. They should not be changed while translating. |
The following command (python in PATH needed) generates the localization files for the flutter project from the i18n files.
python localization.py
Important: do not forget to add the new locales in:
ios/Runner/Info.plist
-
lib/main.dart
Setting up the TensorFlow lite interpreter depends on the platform you want to develop for. Therefore refer to thetflite_flutter
package for the installation.
Additionally the tflite models (and their labels) need to be copied from the Machine Learning repository.
Go to the release page, download the files and move them to the dakanji\assets\
A complete overview of all screens, popups and oerlays can be found here.
For updating the icons the flutter_launcher_icons package was used.
To update all icons, replace media/icon.png
and run:
flutter pub run flutter_launcher_icons:main
For generating a splashscreen the flutter_native_splash package was used.
The details of the splashscreen are stored in flutter_native_splash.yaml
.
To generate platform dependent splashscreens just invoke (in the root folder):
flutter pub run flutter_native_splash:create
To build the app as app bundle just invoke
flutter build appbundle
To obfuscate, save the symbol files and build the app.
flutter build appbundle --obfuscate --split-debug-info=obfuscate_debug_info
To build an fat apk:
flutter build apk --obfuscate --split-debug-info=obfuscate_debug_info
and platform dependent, smaller apk's:
flutter build apk --split-per-abi --obfuscate --split-debug-info=obfuscate_debug_info