Skip to content

Latest commit

 

History

History
164 lines (131 loc) · 6.52 KB

File metadata and controls

164 lines (131 loc) · 6.52 KB

IR TV Remote App - Development Plan

Project Overview

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.).

Technology Stack

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

Why Native Android?

  1. Direct hardware access - ConsumerIrManager requires native Android APIs
  2. No IR on iOS - iPhones lack IR blasters, cross-platform adds no value
  3. Performance - IR timing is critical; native code ensures precision
  4. Security - Fewer dependencies = smaller attack surface

Architecture

┌─────────────────────────────────────────────────┐
│                 Presentation Layer              │
│  (Jetpack Compose UI + ViewModels)              │
├─────────────────────────────────────────────────┤
│                  Domain Layer                   │
│  (Use Cases, Repository Interfaces)             │
├─────────────────────────────────────────────────┤
│                   Data Layer                    │
│  ┌──────────────┐  ┌──────────────────────────┐ │
│  │ IR Hardware  │  │  IR Code Database        │ │
│  │ (ConsumerIr) │  │  (Room + JSON assets)    │ │
│  └──────────────┘  └──────────────────────────┘ │
└─────────────────────────────────────────────────┘

Security Measures (OWASP Mobile Top 10 Compliant)

  1. No network permissions - App works entirely offline
  2. Input validation - Sanitize all user inputs for custom IR codes
  3. ProGuard/R8 obfuscation - Protect against reverse engineering
  4. No hardcoded secrets - Following security best practices
  5. Secure storage - EncryptedSharedPreferences for user preferences
  6. Dependency scanning - Regular vulnerability checks
  7. No WebViews - Eliminates XSS attack vectors
  8. Minimal permissions - Only request what's necessary

IR Protocol Support

Priority 1: Samsung TVs

  • Samsung IR protocol (38kHz carrier frequency)
  • NEC protocol variant used by Samsung
  • Complete button mapping (power, volume, channel, smart hub, source, etc.)

Priority 2: Universal Support

  • NEC - Most common protocol (LG, Vizio, many others)
  • RC5/RC6 - Philips protocol
  • Sony SIRC - Sony devices
  • Additional brands - Panasonic, TCL, Hisense, Sharp, Toshiba

Project Structure

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

Development Phases

Phase 1: Foundation

  • Project setup and architecture scaffolding
  • Gradle configuration with all dependencies
  • IR hardware wrapper implementation
  • Basic project structure

Phase 2: Core Features

  • Samsung IR codes database
  • Basic remote UI with essential buttons
  • IR transmission functionality

Phase 3: Universal Support

  • Additional TV brand codes
  • Brand selection flow
  • Device management

Phase 4: Advanced Features

  • Custom remote layouts
  • Learning mode (capture codes from existing remotes)
  • Favorite channels
  • Widget support

Phase 5: Polish

  • Accessibility improvements
  • Comprehensive testing
  • Performance optimization
  • App store preparation

Compatible Devices

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

Dependencies

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

Testing Strategy

  • Unit Tests - Domain logic, IR code parsing
  • Integration Tests - Repository implementations
  • UI Tests - Compose UI testing
  • Manual Testing - Real device IR transmission testing

License

This project is for personal/educational use.


Plan created: November 2024