A universal IR (Infrared) TV Remote Android application with priority support for Samsung TVs. Designed for Android devices with built-in IR blasters (Samsung, Xiaomi, Vivo, Huawei, LG, etc.).
| Component | Choice | Rationale |
|---|---|---|
| Platform | Android | Only platform with native IR blaster support via ConsumerIrManager API |
| Language | Kotlin | Modern, null-safe, official Android language, reduces vulnerabilities |
| Min SDK | API 19 (Android 4.4) | When ConsumerIrManager was introduced |
| Target SDK | API 34 (Android 14) | Latest stable with security patches |
| Build System | Gradle with Kotlin DSL | Type-safe, modern standard |
| Architecture | MVVM + Clean Architecture | Separation of concerns, testable |
| DI Framework | Hilt | Official Android DI, compile-time safety |
| UI | Jetpack Compose | Modern, declarative, fewer UI bugs |
| Database | Room | Type-safe SQLite wrapper for IR codes |
- Direct hardware access -
ConsumerIrManagerrequires native Android APIs - No IR on iOS - iPhones lack IR blasters, cross-platform adds no value
- Performance - IR timing is critical; native code ensures precision
- Security - Fewer dependencies = smaller attack surface
┌─────────────────────────────────────────────────┐
│ Presentation Layer │
│ (Jetpack Compose UI + ViewModels) │
├─────────────────────────────────────────────────┤
│ Domain Layer │
│ (Use Cases, Repository Interfaces) │
├─────────────────────────────────────────────────┤
│ Data Layer │
│ ┌──────────────┐ ┌──────────────────────────┐ │
│ │ IR Hardware │ │ IR Code Database │ │
│ │ (ConsumerIr) │ │ (Room + JSON assets) │ │
│ └──────────────┘ └──────────────────────────┘ │
└─────────────────────────────────────────────────┘
- No network permissions - App works entirely offline
- Input validation - Sanitize all user inputs for custom IR codes
- ProGuard/R8 obfuscation - Protect against reverse engineering
- No hardcoded secrets - Following security best practices
- Secure storage -
EncryptedSharedPreferencesfor user preferences - Dependency scanning - Regular vulnerability checks
- No WebViews - Eliminates XSS attack vectors
- Minimal permissions - Only request what's necessary
- Samsung IR protocol (38kHz carrier frequency)
- NEC protocol variant used by Samsung
- Complete button mapping (power, volume, channel, smart hub, source, etc.)
- NEC - Most common protocol (LG, Vizio, many others)
- RC5/RC6 - Philips protocol
- Sony SIRC - Sony devices
- Additional brands - Panasonic, TCL, Hisense, Sharp, Toshiba
app/
├── src/main/
│ ├── java/com/example/tvremote/
│ │ ├── di/ # Hilt dependency injection modules
│ │ ├── data/
│ │ │ ├── ir/ # ConsumerIrManager wrapper
│ │ │ ├── database/ # Room entities, DAOs
│ │ │ └── repository/ # Repository implementations
│ │ ├── domain/
│ │ │ ├── model/ # Domain models
│ │ │ ├── repository/ # Repository interfaces
│ │ │ └── usecase/ # Business logic
│ │ └── ui/
│ │ ├── remote/ # Remote control screens
│ │ ├── setup/ # Device setup flow
│ │ ├── components/ # Reusable UI components
│ │ └── theme/ # Compose theming
│ ├── assets/
│ │ └── ir_codes/ # JSON IR code databases
│ └── res/
│ ├── drawable/ # Icons and graphics
│ └── values/ # Strings, colors, themes
├── build.gradle.kts
└── proguard-rules.pro
- Project setup and architecture scaffolding
- Gradle configuration with all dependencies
- IR hardware wrapper implementation
- Basic project structure
- Samsung IR codes database
- Basic remote UI with essential buttons
- IR transmission functionality
- Additional TV brand codes
- Brand selection flow
- Device management
- Custom remote layouts
- Learning mode (capture codes from existing remotes)
- Favorite channels
- Widget support
- Accessibility improvements
- Comprehensive testing
- Performance optimization
- App store preparation
The app requires an Android device with a built-in IR blaster:
- Vivo - Various models with IR blaster
- Xiaomi - Mi/Redmi series (many models)
- Samsung - Galaxy S series (up to S6)
- Huawei - Mate/P series (select models)
- LG - G series (older models)
- Other - Various Chinese OEM devices
All dependencies are from trusted sources (Google, JetBrains) and regularly updated:
- AndroidX Core KTX
- Jetpack Compose (with BOM for version alignment)
- Room Database
- Hilt Dependency Injection
- AndroidX Security Crypto
- Material Design 3
- Unit Tests - Domain logic, IR code parsing
- Integration Tests - Repository implementations
- UI Tests - Compose UI testing
- Manual Testing - Real device IR transmission testing
This project is for personal/educational use.
Plan created: November 2024