An Android application that turns your Android device into a USB keyboard using USB Host mode.
- USB HID keyboard emulation
- Virtual keyboard interface
- Support for modifier keys (Shift, Ctrl, Alt)
- Power-efficient operation
- Secure device verification
- Error handling and user feedback
- Android device with USB Host mode support
- Android 7.0 (API level 24) or higher
- USB OTG cable
- Windows 10+ host computer
- Clone the repository:
git clone https://github.com/yourusername/usb-keyboard.git-
Open the project in Android Studio
-
Build and install the app:
./gradlew installDebug- Connect your Android device to a PC using a USB OTG cable
- Launch the USB Keyboard app
- Grant USB permissions when prompted
- Use the virtual keyboard to type on the connected PC
The app follows a modular architecture with these main components:
MainActivity: UI and user interaction handlingUsbConnectionManager: USB device communicationHidDescriptor: USB HID protocol implementationKeyboardReportGenerator: HID report generationSecurityManager: Device verification and securityPowerManager: Power optimizationErrorHandler: Error management and user feedback
- Device whitelisting
- Vendor verification
- Security risk assessment
- Encrypted communication
- Android Keystore integration
- Wake lock management
- Buffer reuse
- Inactivity detection
- Screen state management
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.