Skip to content

ayushthonge/unctrl-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FyreApp - Android Application

A modern Android app built with Kotlin for visualizing game controller input, exploring your installed games with controller support, and connecting to Bluetooth gamepads and macro devices. Features a beautiful, responsive UI with smooth animations, intuitive navigation, rich game data from IGDB API, and comprehensive Bluetooth device management.

Features

🎮 Controller Input Visualization

  • Real-time Input Display: See live joystick, trigger, and button input from your connected game controller
  • Responsive Layout: Optimized for both portrait and landscape orientations
  • Horizontal Trigger Bars: L2 and R2 triggers displayed as horizontal progress bars
  • Joystick Visualization: Left and right joysticks with real-time dot movement
  • Button State Feedback: All controller buttons (A, B, X, Y, D-pad, L1, R1, Start, Menu) show pressed states
  • Smart Exit: Press B once to see "Hold B to exit" toast, then hold B to exit the test
  • Navigation Drawer: Access home, settings, and logout options

📱 Bluetooth Device Management

  • Gamepad Connection: Connect to Bluetooth gamepads and macro devices
  • Dual Connection Modes:
    • Direct Connection (BLE): Connect to unpaired devices without prior pairing
    • Paired Device Connection: Connect to already paired devices
  • Device Discovery: Scan and discover nearby Bluetooth devices
  • Device Information: View detailed device information including:
    • MAC address and connection status
    • Firmware version and hardware version
    • Project coding and device capabilities
  • OTA Firmware Updates: Over-the-air firmware updates using .bin files
  • Device Testing: Comprehensive testing interface with:
    • Battery level queries
    • Calibration dialogs
    • Device configuration options
    • Macro key mapping and testing
    • Burst mode testing
    • Lighting effects configuration
    • Trigger and rocker calibration
  • External SDK Integration: Full integration with proprietary Bluetooth communication SDK
  • Permission Management: Automatic handling of Bluetooth permissions for different Android versions

🏠 Modern Home Screen

  • Navigation Drawer: Slide-out menu with Home, Bluetooth Connection, Settings, and Logout options
  • Game Carousels:
    • Top Games: Shows your installed games with real app icons
    • Recently Played: Tracks and displays your recently played games
    • Controller Features: Quick access to Controller Input and Debug Info
  • Responsive Design: Adapts beautifully to different screen sizes and orientations
  • Smooth Animations: Elegant transitions between screens

🎯 Enhanced Game Detail Pages

  • Rich Game Information: Title, description, genre, last played time, and play time
  • IGDB API Integration: Fetches comprehensive game data including:
    • Game Summary: Detailed descriptions from IGDB database
    • Screenshots: High-quality game screenshots in carousel view
    • Genres: Multiple genre tags with chip design
    • Platforms: Supported gaming platforms
    • Ratings: User ratings and review counts
    • Age Ratings: Content rating information
    • Developer & Publisher: Company information
  • Dynamic Game Icons: Displays the actual game's icon as the cover image
  • Responsive Layout:
    • Portrait: Vertical layout with cover image at top
    • Landscape: Side-by-side layout with cover image on left, content on right
  • Action Buttons:
    • ▶ Play: Launches the selected game/app
    • 🎮 Controller Layout: Opens controller input test
    • ⬅ Back: Returns to home screen
  • Fancy Animations: Staggered entrance animations with fade-in, slide-up, and scale effects
  • Screenshot Carousel: Swipe through game screenshots with navigation buttons

📚 Game Library

  • Smart App Detection: Scans installed apps and matches against curated game lists
  • Controller Support Indicators: 🎮 Full, 🕹️ Partial, ❓ Likely, N/A
  • Pricing Information: 🆓 Free, 💲 Paid
  • Category Organization: Games, Emulators, Game Services, Game-Adjacent
  • Horizontal Carousels: Smooth scrolling through app categories
  • Direct Launch: Click any app to launch it immediately

🔧 Debug & Development

  • Debug Info Screen: View all installed packages for troubleshooting
  • Screen Awake: Game Library and Controller Input screens keep device awake
  • Comprehensive Logging: Detailed logs for debugging controller input and app behavior
  • API Integration: IGDB API with rate limiting and error handling

Building and Running

Prerequisites

  • Android SDK installed
  • ADB (Android Debug Bridge) available in PATH
  • Connected Android device or running emulator
  • Java 21 (for compilation)

Build the App

./gradlew assembleDebug

Install and Run on Device

The easiest way to install and run the app on a connected device:

./gradlew installAndRun

This command will:

  1. Check for available Android devices/emulators
  2. Build the APK if it doesn't exist
  3. Install the APK on the first available device
  4. Launch the app automatically

Manual Installation

If you prefer to install manually:

# Build the APK
./gradlew assembleDebug

# Install on connected device
adb install app/build/outputs/apk/debug/app-debug.apk

# Launch the app
adb shell am start -n com.example.fyreapp/.SplashActivity

Project Structure

fyre-android-app/
├── app/
│   ├── src/main/
│   │   ├── java/com/example/fyreapp/
│   │   │   ├── api/
│   │   │   │   ├── IGDBApiManager.kt
│   │   │   │   └── IGDBApiService.kt
│   │   │   ├── bluetooth/
│   │   │   │   ├── SelectConnectActivity.java
│   │   │   │   ├── BluetoothMainActivity.java
│   │   │   │   ├── DeviceDetailActivity.java
│   │   │   │   ├── DemoActivity.java
│   │   │   │   ├── SetMacroKeyMappingActivity.java
│   │   │   │   ├── ShowInfoActivity.java
│   │   │   │   ├── BluetoothUtil.java
│   │   │   │   ├── BleDevice.java
│   │   │   │   ├── BleDeviceAdapter.java
│   │   │   │   ├── TimerCallBack.java
│   │   │   │   ├── ButtonSupport.java
│   │   │   │   ├── MacroKey.java
│   │   │   │   ├── MacroChild.java
│   │   │   │   ├── MacroEvent.java
│   │   │   │   └── Mapping.java
│   │   │   ├── config/
│   │   │   │   └── IGDBConfig.kt
│   │   │   ├── models/
│   │   │   │   └── IGDBModels.kt
│   │   │   ├── FyreApplication.java
│   │   │   ├── SplashActivity.kt
│   │   │   ├── HomeActivity.kt
│   │   │   ├── HomeFragment.kt
│   │   │   ├── DetailFragment.kt
│   │   │   ├── SettingsFragment.kt
│   │   │   ├── ControllerInputActivity.kt
│   │   │   ├── GameLibraryActivity.kt
│   │   │   ├── GameDetailActivity.kt
│   │   │   ├── DebugInfoActivity.kt
│   │   │   └── GameDataManager.kt
│   │   ├── res/
│   │   │   ├── layout/
│   │   │   │   ├── activity_splash.xml
│   │   │   │   ├── activity_home.xml
│   │   │   │   ├── activity_controller_input.xml
│   │   │   │   ├── activity_game_detail.xml
│   │   │   │   ├── activity_game_library.xml
│   │   │   │   ├── activity_debug_info.xml
│   │   │   │   ├── activity_select_connect.xml
│   │   │   │   ├── activity_main.xml
│   │   │   │   ├── activity_device_detail.xml
│   │   │   │   ├── activity_demo.xml
│   │   │   │   ├── activity_set_macro_key_mapping.xml
│   │   │   │   ├── activity_show_info.xml
│   │   │   │   ├── dialog_calibration_layout.xml
│   │   │   │   ├── list_item_ble_device.xml
│   │   │   │   ├── fragment_home.xml
│   │   │   │   ├── fragment_detail.xml
│   │   │   │   ├── fragment_settings.xml
│   │   │   │   ├── item_game_carousel.xml
│   │   │   │   ├── item_game_entry.xml
│   │   │   │   └── nav_header.xml
│   │   │   ├── anim/
│   │   │   │   ├── fade_in.xml
│   │   │   │   ├── slide_up.xml
│   │   │   │   ├── scale_in.xml
│   │   │   │   ├── slide_in_right.xml
│   │   │   │   ├── slide_out_left.xml
│   │   │   │   ├── slide_in_left.xml
│   │   │   │   └── slide_out_right.xml
│   │   │   ├── drawable/
│   │   │   │   ├── joystick_background.xml
│   │   │   │   ├── joystick_background_orange.xml
│   │   │   │   ├── joystick_dot.xml
│   │   │   │   ├── joystick_dot_orange.xml
│   │   │   │   ├── trigger_bar_background.xml
│   │   │   │   ├── horizontal_trigger_bar.xml
│   │   │   │   ├── gradient_overlay.xml
│   │   │   │   ├── rounded_background.xml
│   │   │   │   ├── circular_button_background.xml
│   │   │   │   ├── ic_back.xml
│   │   │   │   ├── ic_home.xml
│   │   │   │   ├── ic_settings.xml
│   │   │   │   └── ic_logout.xml
│   │   │   ├── navigation/
│   │   │   │   └── nav_graph.xml
│   │   │   ├── menu/
│   │   │   │   └── nav_drawer_menu.xml
│   │   │   └── values/
│   │   │       ├── strings.xml
│   │   │       ├── colors.xml
│   │   │       └── themes.xml
│   │   ├── assets/
│   │   │   └── *.bin (OTA firmware files)
│   │   └── AndroidManifest.xml
│   ├── libs/
│   │   └── bluetooth_communication_1.0.7.jar
│   └── build.gradle.kts
├── scripts/
│   ├── install-and-run.bat
│   └── install-and-run.sh
└── build.gradle.kts

Technical Features

🎨 UI/UX

  • Material Design: Modern card-based layouts with proper elevation and shadows
  • Responsive Design: Adapts to different screen sizes and orientations
  • Smooth Animations: Custom entrance animations and page transitions
  • Dark Theme: Consistent dark color scheme throughout the app
  • Navigation: Jetpack Navigation with drawer layout
  • ViewPager2: Smooth screenshot carousel with navigation controls

📱 Bluetooth Integration

  • External SDK: Integration with proprietary bluetooth_communication_1.0.7.jar
  • BLE Support: Bluetooth Low Energy device discovery and connection
  • Permission Management: Automatic handling of Bluetooth permissions for Android API 31+ and below
  • Device Management: Comprehensive device information and status monitoring
  • OTA Updates: Over-the-air firmware updates with progress tracking
  • Testing Interface: Full device testing and configuration capabilities
  • Macro Support: Advanced macro key mapping and testing features

🌐 API Integration

  • IGDB API: Comprehensive game database integration via Twitch API
  • Rate Limiting: Built-in rate limiting (800 requests/minute) to respect API limits
  • Caching: Intelligent caching for genres, platforms, companies, and age ratings
  • Error Handling: Robust error handling with fallbacks to local data
  • Authentication: Automatic OAuth token management with refresh
  • Image Loading: High-quality game covers and screenshots with Glide

🎮 Controller Support

  • Input Detection: Supports both joystick and gamepad input sources
  • Real-time Visualization: Live updates of all controller inputs
  • Calibration: Built-in joystick calibration options
  • Button Mapping: Comprehensive mapping for all standard controller buttons

📱 Android Features

  • Package Manager Integration: Dynamic app detection and launching
  • Shared Preferences: Persistent storage for recently played games
  • Activity Lifecycle: Proper handling of app state and navigation
  • Error Handling: Graceful fallbacks for missing apps or icons
  • Coroutines: Asynchronous operations with proper error handling
  • Retrofit: Type-safe HTTP client for API calls

Dependencies

Core Android

  • AndroidX Core KTX: 1.12.0
  • AppCompat: 1.6.1
  • Material Design: 1.11.0
  • ConstraintLayout: 2.1.4

Navigation

  • Jetpack Navigation Fragment: 2.7.7
  • Jetpack Navigation UI: 2.7.7

Networking & Data

  • Retrofit2: 2.9.0 (HTTP client)
  • OkHttp3: 4.12.0 (HTTP client)
  • Moshi: 1.15.0 (JSON parsing)
  • Glide: 4.16.0 (Image loading)

UI Components

  • ViewPager2: 1.0.0 (Screenshot carousel)

Bluetooth & Permissions

  • RxAndroid: 2.1.1 (Reactive programming)
  • RxAndroidBLE: 1.19.0 (BLE operations)
  • EasyPermissions: 3.0.0 (Permission handling)
  • PermissionX: 1.7.1 (Modern permission handling)

External SDK

  • bluetooth_communication_1.0.7.jar: Proprietary Bluetooth communication SDK

Configuration

IGDB API Setup

The app uses IGDB API for enhanced game data. Configuration is handled in IGDBConfig.kt:

object IGDBConfig {
    const val CLIENT_ID = "your_client_id"
    const val CLIENT_SECRET = "your_client_secret"
    const val MAX_REQUESTS_PER_MINUTE = 800
    const val REQUEST_DELAY_MS = 75L
}

Note: For production use, move API credentials to secure storage (BuildConfig, encrypted preferences, or environment variables).

Bluetooth Permissions

The app automatically handles Bluetooth permissions for different Android versions:

  • Android API 30 and below: BLUETOOTH, BLUETOOTH_ADMIN, ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION
  • Android API 31+: BLUETOOTH_SCAN, BLUETOOTH_ADVERTISE, BLUETOOTH_CONNECT

Troubleshooting

Build Issues

  • No devices found: Make sure you have a device connected via USB with USB debugging enabled, or an emulator running
  • Build fails: Ensure Android SDK is properly configured in local.properties
  • Java version issues: Ensure Java 21 is installed and configured
  • Bluetooth SDK issues: Ensure bluetooth_communication_1.0.7.jar is present in app/libs/

Runtime Issues

  • Installation fails: Check that the device is properly connected and authorized
  • Controller not detected: Ensure your controller is properly connected and recognized by Android
  • Game icons not loading: Some apps may not have accessible icons; the app will show a default icon
  • IGDB API errors: Check network connectivity and API credentials
  • Bluetooth not working: Ensure Bluetooth is enabled and permissions are granted
  • Device not found: Check that the target device is in pairing mode and within range

API Issues

  • Rate limiting: The app automatically handles IGDB API rate limits (800 requests/minute)
  • Authentication errors: Tokens are automatically refreshed when expired
  • Network timeouts: API calls have 30-second timeouts with fallback to local data

Bluetooth Issues

  • Permission denied: Grant Bluetooth permissions when prompted
  • Device not connecting: Ensure the device is compatible and in pairing mode
  • OTA update fails: Check that the firmware file is valid and device supports OTA updates
  • SDK errors: Ensure the external Bluetooth SDK is properly integrated

Future Enhancements

  • Cloud Sync: Sync game library and preferences across devices
  • Custom Controller Profiles: Save and load custom controller configurations
  • Game Statistics: Track play time and usage statistics
  • Social Features: Share game recommendations and achievements
  • Advanced Filtering: Filter games by genre, controller support, or other criteria
  • Offline Mode: Cache game data for offline viewing
  • Game Recommendations: AI-powered game suggestions based on play history
  • Controller Compatibility Database: User-contributed controller compatibility information
  • Advanced Bluetooth Features: Multi-device support, device profiles, and advanced macro configurations
  • Firmware Management: Automatic firmware update checking and installation
  • Device Analytics: Usage statistics and performance monitoring for connected devices

About

Android app for Type-C game controller — optimized for COD Mobile and BGMI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors