Skip to content

D4vRAM369/TapTranslate

Repository files navigation

TapTranslate

Instant, private, offline translation — directly from any app's text selection menu.

Android Kotlin ML Kit Compose License Ask DeepWiki


What is TapTranslate?

TapTranslate is a minimalist Android utility that integrates directly into your OS text-selection menu. Select any text in any app, tap the three-dot overflow menu, and choose TapTranslate — your text is translated instantly, offline, with no data ever leaving your device.

No ads. No cloud. No account. Just translation.


Key Features

  • ⚡ Instant — Translates in-place via ACTION_PROCESS_TEXT. The text you selected is replaced by its translation automatically.
  • 🔒 100% Private — Powered by Google ML Kit On-Device Translation. All processing happens locally. Zero network requests during translation.
  • 🌐 Bidirectional — Toggle between Spanish → English (Write Mode) and English → Spanish (Read Mode) from the settings panel.
  • 🤖 Auto-Paste — For apps that restrict the context menu (e.g. other users' Reddit comments), share text to TapTranslate and it auto-pastes the translation using Android's Accessibility API.
  • 🎨 Minimal UI — Built with Jetpack Compose, following the MVVM (Model-View-ViewModel) architectural pattern for robustness.
  • 📱 Adaptive Icon — Professional launcher icon (mipmap-anydpi) that adapts to device shapes (circle, square) without white borders.
  • 🌍 Localized — UI adapts to your system language (English / Spanish supported).
  • 📝 Clean Code — Centralized constants and professional package structuring.

How It Works

[User selects text in any app]
         ↓
[OS text menu shows TapTranslate]
         ↓
[ProcessTextActivity receives the text (Interception Layer)]
         ↓
[MainViewModel manages the state and logic trigger]
         ↓
[TranslationEngine calls ML Kit NMT (Neural Machine Translation) model]
         ↓
[Translated text is returned to the originating app]

For read-only text in closed apps (Reddit posts, etc.):

[User shares text  →  TapTranslate]
         ↓
[Translation is copied to clipboard]
         ↓
[AutoPasteService (Accessibility) injects ACTION_PASTE into focused field]

Requirements

Requirement Version
Android OS 6.0+ (API 24)
Target SDK Android 15 (API 35)
Build Tools Android Gradle Plugin 8.2.0
Gradle 8.4
Kotlin 1.9.24
Java 17

Installation

Build from Source

  1. Clone the repository:

    git clone https://github.com/D4vRAM369/TapTranslate.git
    cd TapTranslate
  2. Open in Android Studio (Hedgehog or newer).

  3. Sync Gradle and run on your device or emulator (API 24+).

  4. First launch: go through the onboarding carousel and optionally enable the Accessibility Service for Auto-Paste.


First-Time Setup

Step 1 — Basic Translation (works everywhere)

No setup needed. After installing, select any text in any app → tap ⋯ → choose TapTranslate.

Step 2 — Auto-Paste Mode (optional, for restricted apps)

For full automation in apps like Reddit:

  1. Open TapTranslate.
  2. Tap the ⚠️ Super-Autopaste Disabled banner.
  3. In the Accessibility settings, find TapTranslate and enable it.
  4. Return to TapTranslate — the banner disappears confirming it's active.

Project Structure

app/
├── src/main/
│   ├── java/com/d4vram/taptranslate/
│   │   ├── AppConstants.kt           # Centralized magic strings and keys
│   │   ├── AutoPasteService.kt       # Accessibility Service — auto-paste engine
│   │   ├── MainActivity.kt           # Orquestrator (Jetpack Compose View)
│   │   ├── MainViewModel.kt          # UI State management (ViewModel)
│   │   ├── OnboardingScreen.kt       # First-run carousel (HorizontalPager)
│   │   ├── PreferencesManager.kt     # SharedPreferences wrapper (Model)
│   │   ├── ProcessTextActivity.kt    # Invisible interceptor — translation trigger
│   │   └── TranslationEngine.kt      # ML Kit NMT wrapper — translation logic
│   ├── res/
│   │   ├── drawable/
│   │   │   ├── ic_launcher_background.xml
│   │   │   └── ic_launcher_foreground.xml
│   │   ├── values/
│   │   │   └── strings.xml           # ES strings (default)
│   │   ├── values-en/
│   │   │   └── strings.xml           # EN strings
│   │   └── xml/
│   │       └── accessibility_service_config.xml
│   └── AndroidManifest.xml
├── build.gradle.kts
└── gradle/wrapper/
    └── gradle-wrapper.properties     # Gradle 8.4 pinned

Tech Stack

Layer Technology
Language Kotlin
UI Jetpack Compose + Material Design 3 (MVVM Pattern)
Translation AI Google ML Kit NMT (Neural Machine Translation)
Async Kotlin Coroutines + kotlinx-coroutines-play-services + StateFlow
Persistence Android SharedPreferences
OS Integration ACTION_PROCESS_TEXT, ACTION_SEND, AccessibilityService

Privacy

TapTranslate does not:

  • Connect to any external server
  • Collect any user data
  • Require an internet connection to translate

The Accessibility Service permission is used exclusively to paste translated text into the focused input field after using the Share route. It does not read, log, or transmit screen content.


Known Limitations

  • Only supports Spanish ↔ English translation in v1.0. Additional language pairs planned.
  • First use requires a one-time ~30MB model download per language pair.
  • Auto-Paste via Accessibility requires manual permission activation by the user (Android security policy).
  • Some apps may suppress the ACTION_PROCESS_TEXT menu entirely (use Share fallback instead).

Roadmap

  • Support for additional language pairs (FR, DE, PT…)
  • Language auto-detection (remove manual mode toggle)
  • ViewModel + MVVM architecture refactor
  • Unit test coverage for Constants and basic logic
  • UI Test coverage (Espresso/Compose test)
  • Play Store listing

License

MIT License © 2026 D4vRAM369

About

TapTranslate brings instant on-device translation to Android with text selection, share actions, and accessibility overlays. Just select or copy text, tap TapTranslate, and translate in seconds without leaving your app.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages