Skip to content

Commit

Permalink
Objectbox (#400)
Browse files Browse the repository at this point in the history
* replaced SQLite/RoomDb with Objectbox for improved dictionary performance

* SQLite words are automatically cleaned up when opening the Preferences

* added protection against deleting dictionaries while loading other dictionaries

* enabled adding words with apostrophes in Ukrainian

* updated system requirements
  • Loading branch information
sspanak authored Dec 21, 2023
1 parent 7fb1ca7 commit c02b414
Show file tree
Hide file tree
Showing 28 changed files with 684 additions and 682 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ or get the APK from the [Releases Section](https://github.com/sspanak/tt9/releas
## System Requirements
- Android 4.4 or higher. _(Tested and confirmed on Android 4.4.2, 10 and 11)_
- Free space:
- Minimum 30 Mb when not using Predictive mode and no dictionaries are loaded.
- Plenty of space per each enabled language in Predictive mode (25-100 Mb, depending on the word count).
- Minimum 40 Mb when not using Predictive mode and no dictionaries are loaded.
- Plenty of space per each enabled language in Predictive mode (50-400 Mb, depending on the word count).
- A hardware keypad or a keyboard. For touchscreen-only devices, an on-screen keypad can be enabled in the Settings.

_If you own a phone with Android 2.2 up to 4.4, please refer to the original version of Traditional T9 from 2016._
Expand Down
13 changes: 7 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,20 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:8.0.2'
classpath 'gradle.plugin.at.zierler:yaml-validator-plugin:1.5.0'
classpath("io.objectbox:objectbox-gradle-plugin:3.7.1")
}
}

apply plugin: 'com.android.application'
apply plugin: 'at.zierler.yamlvalidator'
apply plugin: "io.objectbox"

apply from: 'gradle/scripts/constants.gradle'
apply from: 'gradle/scripts/dictionary-tools.gradle'
apply from: 'gradle/scripts/validate-languages.gradle'
apply from: 'gradle/scripts/version-tools.gradle'

configurations.configureEach {
// fixes 'duplicate class error', when using these combine: androidx.core:1.10.1, androidx.preference:1.2.0 and androidx.room:2.5.1
// see: https://stackoverflow.com/questions/75274720/a-failure-occurred-while-executing-appcheckdebugduplicateclasses/75315276#75315276
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'

yamlValidator {
searchPaths = ['languages/definitions']
}
Expand All @@ -32,8 +31,10 @@ configurations.configureEach {
dependencies {
implementation 'androidx.core:core:1.10.1'
implementation 'androidx.preference:preference:1.2.1'
implementation 'androidx.room:room-runtime:2.5.2'
annotationProcessor 'androidx.room:room-compiler:2.5.2'

// fixes 'duplicate class error' when using "androidx.core" > 1.9.0
// see: https://stackoverflow.com/a/77323424
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
}

repositories {
Expand Down
78 changes: 78 additions & 0 deletions objectbox-models/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"_note1": "KEEP THIS FILE! Check it into a version control system (VCS) like git.",
"_note2": "ObjectBox manages crucial IDs for your object model. See docs for details.",
"_note3": "If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.",
"entities": [
{
"id": "1:8686759156275895115",
"lastPropertyId": "9:148562041880145406",
"name": "Word",
"properties": [
{
"id": "1:7053654361616810150",
"name": "id",
"type": 6,
"flags": 1
},
{
"id": "2:1100881396300803213",
"name": "frequency",
"type": 5
},
{
"id": "3:3482550679443532896",
"name": "isCustom",
"type": 1
},
{
"id": "4:7366572918924354162",
"name": "langId",
"type": 5
},
{
"id": "5:2610279871343053806",
"name": "length",
"type": 5
},
{
"id": "6:5269773217039117329",
"name": "sequence",
"indexId": "1:2971223841434624317",
"type": 9,
"flags": 2048
},
{
"id": "7:3922044271904033267",
"name": "sequenceShort",
"indexId": "2:2641086768976362614",
"type": 2,
"flags": 8
},
{
"id": "8:1684236207225806285",
"name": "uniqueId",
"indexId": "3:5820769207826940948",
"type": 9,
"flags": 34848
},
{
"id": "9:148562041880145406",
"name": "word",
"type": 9
}
],
"relations": []
}
],
"lastEntityId": "1:8686759156275895115",
"lastIndexId": "3:5820769207826940948",
"lastRelationId": "0:0",
"lastSequenceId": "0:0",
"modelVersion": 5,
"modelVersionParserMinimum": 5,
"retiredEntityUids": [],
"retiredIndexUids": [],
"retiredPropertyUids": [],
"retiredRelationUids": [],
"version": 1
}
Loading

0 comments on commit c02b414

Please sign in to comment.