2022-01-15 18:55:05 +01:00
# Contributing
Thanks for contributing :)
## Building the app
The application doesn't use Gradle and it might be hard to use some features of
Android Studio.
Fortunately, there's not many dependencies:
- OpenJDK 8
2022-02-07 01:11:55 +01:00
- Android SDK: build tools (minimum `28.0.1` ), platform `30`
2022-01-15 18:55:05 +01:00
- Make sure to have the `$ANDROID_HOME` environment variable set.
2022-04-24 20:52:36 +02:00
For Nix users, the right environment can be obtained with `nix-shell ./shell.nix` .
Instructions to install Nix are [here ](https://nixos.wiki/wiki/Nix_Installation_Guide ).
2022-01-15 18:55:05 +01:00
Building the debug apk:
```sh
make
```
2022-04-24 20:52:36 +02:00
If the build succeed, the debug apk is located in `_build/juloo.keyboard2.debug.apk` .
2022-04-24 19:59:36 +02:00
2022-04-02 16:33:12 +02:00
## Using the local debug.keystore on the Github CI actions
It's possible to save the local debug.keystore into a github secret, so the same keystore is utilized to build the debug apk in the CI github actions.
Doing this, they wil have the same signature, thus the debug apk can be updated without having to uninstall it first.
After you sucessfully run `make` , (thus a debug.keystore exists) you can use this second command to generate a base64 stringified version of it
```sh
cd _build
gpg -c --armor --pinentry-mode loopback --passphrase debug0 --yes "debug.keystore"
```
A file will be generated inside the local `_build/` folder, called `debug.keystore.asc`
You can copy the content of this file, and with that, paste it into a new github secret in your repo settings.
The secret must be named `DEBUG_KEYSTORE`
2022-01-15 18:55:05 +01:00
## Debugging on your phone
2022-01-20 21:21:07 +01:00
First [Enable adb debugging on your device ](https://developer.android.com/studio/command-line/adb#Enabling ).
Then connect your phone to your computer using an USB cable or wireless
debugging.
2022-01-15 18:55:05 +01:00
2022-01-20 21:21:07 +01:00
And finally, install the application with:
2022-01-15 18:55:05 +01:00
```sh
make installd
```
The debug version of the application won't be removed, both versions will stay
installed at the same time.
2022-01-15 19:03:53 +01:00
2022-01-15 19:51:40 +01:00
The application must be enabled in the settings:
2022-01-20 21:21:07 +01:00
System > Languages & input > On-screen keyboard > Manage on-screen keyboards.
2022-01-15 19:51:40 +01:00
2022-01-15 19:03:53 +01:00
## Debugging the application: INSTALL_FAILED_UPDATE_INCOMPATIBLE
`make installd` can fail with the following error message:
```
adb: failed to install _build/juloo.keyboard2.debug.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package juloo.keyboard2.debug signatures do not match previously installed version; ignoring!]
make: ** * [Makefile:20: installd] Error 1
```
The application can't be "updated" because the temporary certificate has been
2022-01-15 19:51:40 +01:00
lost. The solution is to uninstall and install again.
The application must be enabled again in the settings.
2022-01-15 19:03:53 +01:00
```sh
adb uninstall juloo.keyboard2.debug
make installd
```
2022-01-30 13:10:37 +01:00
## Guidelines
2022-04-23 23:39:53 +02:00
### Adding a programming layout
2022-01-30 13:10:37 +01:00
2022-04-23 23:39:53 +02:00
A programming layout must contains every ASCII characters.
The current programming layouts are: QWERTY, Dvorak.
Ideally, programming layouts should allow to type every Latin-script languages
by containing every dead-keys. See for example: 0bf7ff5 (Latvian), 573c13f (Swedish).
It is also possible to add some characters that are hidden in other languages,
for example 93e84ba (ß), though the space is limited.
Layouts are defined in XML, see `res/xml/qwerty.xml` . An entry must be added to
the layout option in `res/values/arrays.xml` , to both `pref_layout_values`
(correspond to the file name) and `pref_layout_entries` (display name).
The layout must also be referenced in `srcs/juloo.keyboard2/Config.java` in
`layoutId_of_string` .
Some users cannot easily type the characters close the the edges of the screen
due to a bulky phone case. It is best to avoid placing important characters
there (such as the digits or punctuation).
### Adding a localized layout
Localized layouts (a layout specific to a language) are gladly accepted.
2022-01-30 13:10:37 +01:00
See for example: 4333575 (Bulgarian), 88e2175 (Latvian), 133b6ec (German).
2022-04-23 23:39:53 +02:00
They don't need to contain every ASCII characters (although it's useful in
passwords) and dead-keys.
### Adding support for a language
2022-01-30 13:10:37 +01:00
2022-04-23 23:39:53 +02:00
Supported locales are defined in `res/xml/method.xml` .
2022-01-30 13:10:37 +01:00
2022-04-23 23:39:53 +02:00
The attributes `languageTag` and `imeSubtypeLocale` define a locale, the
attribute `imeSubtypeExtraValue` defines the default layout and the dead-keys
and other extra keys to show.
2022-01-30 13:10:37 +01:00
### Translations
2022-04-23 23:39:53 +02:00
Translations are always welcome !
See for example: 1723288 (Latvian), baf867a (French).
The app can be translated by writing `res/values-<language code>/strings.xml`
(for example `values-fr` , `values-lv` ), based on the default:
`res/values/strings.xml` (English).
2022-01-30 13:10:37 +01:00
2022-04-23 23:39:53 +02:00
The store description is found in `metadata/android/<locale>/` ,
`short_description.txt` and `full_description.txt` .
Translating changelogs is not useful. Changelogs are written quickly just
before a release and older ones are never shown to anyone currently.
2022-01-30 13:10:37 +01:00
2022-04-23 23:39:53 +02:00
The app name might be partially translated, the "unexpected" word should remain
untranslated.