A modern voice-powered AI assistant for Android TV, built with Jetpack Compose for TV.
Screen_recording_20251207_204854.mp4
Note: If the video doesn't play above, you can find it at
readme_resources/Screen_recording_20251207_204854.mp4
- 🎤 Voice Input — Press the mic button to speak your questions
- 🤖 AI-Powered Responses — Powered by Cloudflare Workers AI (Llama 3.1 8B)
- 🔊 Text-to-Speech — Bot responses are read aloud automatically
- 📺 TV-First Design — Built specifically for Android TV with D-pad navigation
- 🎨 Modern Dark UI — Sleek indigo/purple accent theme
🎤 Record Audio ──► 📝 Speech-to-Text ──► 🤖 LLM ──► 🔊 Text-to-Speech
(Mic) (Whisper) (Llama) (Android TTS)
┌──────────────────────────────────────────────────────────────┐
│ UI Layer │
│ ┌─────────────┐ ┌───────────────┐ ┌────────────────────┐ │
│ │ HomeScreen │ │ HeaderWidget │ │ VocalAssistantVM │ │
│ │ (Compose) │ │ (Compose) │ │ (STT + LLM + TTS) │ │
│ └─────────────┘ └───────────────┘ └────────────────────┘ │
└──────────────────────────────────────────────────────────────┘
▲
│
▼
┌──────────────────────────────────────────────────────────────┐
│ Domain Layer │
│ ┌─────────────────────┐ ┌────────────────────────────────┐ │
│ │ SpeechToTextUseCase │ │ TextGenerationUseCase │ │
│ └─────────────────────┘ └────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────┘
▲
│
▼
┌──────────────────────────────────────────────────────────────┐
│ Data Layer │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ CloudflareRepositoryImpl │ │
│ │ • Speech-to-Text (Whisper) │ │
│ │ • Text Generation (Llama 3.1 8B Instruct) │ │
│ └─────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────┘
- Android Studio Hedgehog or newer
- Android TV device or emulator (API 21+)
- Cloudflare account with Workers AI access
-
Clone the repository
git clone https://github.com/yourusername/ChatbotTVCompose.git cd ChatbotTVCompose -
Configure API credentials
Copy the example environment file:
cp .env.example .env
Edit
.envand add your Cloudflare credentials:CLOUDFLARE_ACCOUNT_ID=your_account_id CLOUDFLARE_API_TOKEN=your_api_token
-
Build and run
./gradlew :tv:installDebug
| Action | Control |
|---|---|
| Navigate | D-pad arrows |
| Select/Confirm | Enter / Center button |
| Start recording | Select mic button, speak |
| Stop recording | Select mic button again |
| Button | Function |
|---|---|
| 🔔 Notifications | Open app notification settings |
| 📱 Apps | Open system apps manager |
| ⚙️ Settings | Open Android settings |
| 🎤 Mic | Start/stop voice recording |
| Category | Technology |
|---|---|
| UI | Jetpack Compose for TV, Material 3 |
| Architecture | MVVM, Clean Architecture |
| DI | Hilt |
| Networking | Retrofit, OkHttp |
| Serialization | Kotlinx Serialization |
| AI Provider | Cloudflare Workers AI |
| STT Model | OpenAI Whisper |
| LLM Model | Meta Llama 3.1 8B Instruct (Fast) |
| TTS | Android TextToSpeech |
tv/src/main/java/com/applicassion/ChatbotTVCompose/
├── data/
│ ├── remote/
│ │ └── ai_provider/
│ │ ├── BaseAIService.kt # Generic AI service interface
│ │ └── cloudflare/
│ │ ├── CloudflareWorkersBaseAIService.kt
│ │ └── dto/ # Data Transfer Objects
│ └── repository_impl/
│ └── CloudflareRepositoryImpl.kt
├── di/
│ └── CloudflareModule.kt # Hilt dependency injection
├── domain/
│ ├── model/ # Domain models
│ ├── repository/
│ │ └── AIRepository.kt
│ └── usecase/
│ ├── SpeechToTextUseCase.kt
│ └── TextGenerationUseCase.kt
├── ui/
│ ├── screens/
│ │ └── home/
│ │ └── HomeScreen.kt
│ ├── widgets/
│ │ ├── HeaderWidget.kt
│ │ ├── ChatBubble.kt
│ │ └── TvCircularProgressIndicator.kt
│ ├── theme/
│ │ └── Color.kt
│ └── VocalAssistantViewModel.kt
└── utils/
└── Constants.kt
| Variable | Description |
|---|---|
CLOUDFLARE_ACCOUNT_ID |
Your Cloudflare account ID |
CLOUDFLARE_API_TOKEN |
API token with Workers AI permissions |
This project is licensed under the MIT License - see the LICENSE file for details.
- Cloudflare Workers AI for the AI models
- Jetpack Compose for TV for the UI framework
- Material Design 3 for design guidelines
Built with ❤️ for Android TV