Skip to content
CleverKeys Wiki
implemented v1.2.9 User guide

First Time Setup Technical Specification

Overview

Initial keyboard configuration flow including language pack download and preference initialization.

Key Components

ComponentFilePurpose
Settings ActivitySettingsActivity.ktMain configuration UI
ConfigConfig.ktDefault values and preference keys
DirectBootPrefsDirectBootAwarePreferences.ktDevice-encrypted storage
Language ManagerLanguagePackManager.ktDownload and install language packs

Initialization Flow

App Install

First keyboard launch

Check isFirstRun preference

Show setup wizard (if first run)

Layout selection → Language pack download → Theme selection

Mark isFirstRun = false

Normal keyboard operation

Configuration Storage

StorageFileContents
Preferencesshared_prefs/cleverkeys_prefs.xmlUser settings
Device Protectedshared_prefs/neural_performance_stats.xmlStats (encrypted)
Language Packsfiles/language_packs/Downloaded ONNX models

Default Values

Key defaults from Config.kt object Defaults (line 18+):

SettingDefaultSource (Config.kt line)
THEME"cleverkeysdark"20
KEYBOARD_HEIGHT_PORTRAIT3021
KEYBOARD_HEIGHT_LANDSCAPE4022
SHORT_GESTURE_MIN_DISTANCE2899
SHORT_GESTURE_MAX_DISTANCE141100
AUTOCORRECT_ENABLEDtrue153
LONGPRESS_TIMEOUT60070
NEURAL_BEAM_WIDTH6114
NEURAL_MAX_LENGTH20115
NEURAL_CONFIDENCE_THRESHOLD0.01f116
ONNX_XNNPACK_THREADS2247
HAPTIC_ENABLEDtrue63
HAPTIC_SWIPE_COMPLETEfalse69
SMART_PUNCTUATIONtrue77
DOUBLE_SPACE_TO_PERIODtrue86
DOUBLE_SPACE_THRESHOLD50087
LANGUAGE_DETECTION_SENSITIVITY0.6f243
CLIPBOARD_HISTORY_LIMIT50176-177

Language Pack Download

Flow in LanguagePackManager.kt:

  1. Check network connectivity
  2. Fetch pack list from GitHub releases
  3. Download ZIP containing model + dictionary
  4. Extract to language_packs/{lang}/
  5. Verify model loads successfully
  6. Update preferences with available languages