- Added full D-pad navigation for Android TV remote control - Improved TV device detection (Fire TV, Shield, Google TV, etc.) - Row-based navigation: Left/Right stay in row, Up/Down moves between rows - Back button support for closing modals - Enhanced focus styles for 10-foot viewing distance - Separate Mobile and TV download options on download page - Updated deploy script for dual APK releases
2.8 KiB
2.8 KiB
| description |
|---|
| How to test Android TV D-pad navigation on emulator |
Android TV Emulator Testing Workflow
This workflow guides you through testing the StreamFlix app on an Android TV emulator to verify D-pad (remote control) navigation works correctly.
Prerequisites
- Android Studio installed
- Android SDK with emulator tools
- Node.js and npm
Step 1: Setup Android TV Emulator (One-Time)
// turbo
# Check if you have an Android TV system image
sdkmanager --list 2>/dev/null | grep -i "tv\|Television" | head -5
If no TV images are installed:
# Install Android TV system image (API 31)
sdkmanager "system-images;android-31;google_apis;x86_64"
Create the Android TV AVD:
# Create TV emulator (one-time setup)
avdmanager create avd -n "AndroidTV_API31" -k "system-images;android-31;google_apis;x86_64" -d "tv_1080p" --force
Step 2: Start the Emulator
# Start Android TV Emulator
emulator -avd AndroidTV_API31 &
Wait for the emulator to fully boot (shows Android TV home screen).
Step 3: Build and Deploy the App
// turbo
cd /Users/khoa.vo/Downloads/Streamflow-main/frontend
# Build the web app
npm run build
# Sync to Android project
npx cap sync android
// turbo
cd /Users/khoa.vo/Downloads/Streamflow-main/frontend/android
# Build debug APK
./gradlew assembleDebug
// turbo
# Install on emulator
adb install -r /Users/khoa.vo/Downloads/Streamflow-main/frontend/android/app/build/outputs/apk/debug/app-debug.apk
Step 4: Launch and Test
# Launch the app
adb shell am start -n com.streamflix.app/.MainActivity
Step 5: D-Pad Navigation Test Checklist
Use the emulator's D-pad controls (arrow keys on keyboard) to test:
| Test | How to Test | Expected |
|---|---|---|
| Initial Focus | Launch app, wait for content | First video card has red glow border |
| Right Arrow | Press → key | Focus moves to next card in row |
| Left Arrow | Press ← key | Focus moves to previous card |
| Down Arrow | Press ↓ key | Focus moves to row below |
| Up Arrow | Press ↑ key | Focus moves to row above |
| Enter/OK | Press Enter on focused card | Video starts playing or info opens |
| Back Button | Press Backspace or Escape | Returns to previous screen |
| Watch Page | Navigate to a movie, play it | Episode list is navigable with D-pad |
Keyboard Shortcuts in Emulator
- Arrow Keys: D-pad navigation
- Enter: OK/Select button
- Backspace: Back button
- Escape: Also acts as Back
Troubleshooting
Emulator not starting?
# Check if emulator is installed
emulator -list-avds
App not installing?
# Check device connection
adb devices
D-pad not working?
- Make sure Capacitor config points to local build, not remote URL
- Check browser console in Chrome DevTools (chrome://inspect)