{"id":40805280,"url":"https://github.com/fabi019/hid-barcode-scanner","last_synced_at":"2026-01-21T21:01:09.345Z","repository":{"id":62933945,"uuid":"541155377","full_name":"Fabi019/hid-barcode-scanner","owner":"Fabi019","description":"Android app for scanning barcodes and sending them to a PC by emulating a bluetooth keyboard.","archived":false,"fork":false,"pushed_at":"2026-01-20T02:53:15.000Z","size":8206,"stargazers_count":184,"open_issues_count":30,"forks_count":29,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-20T04:02:51.076Z","etag":null,"topics":["android","barcode","bluetooth","jetpack-compose","kotlin","qrcode","scanner"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fabi019.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-09-25T11:56:07.000Z","updated_at":"2026-01-20T01:55:18.000Z","dependencies_parsed_at":"2023-09-27T21:15:08.278Z","dependency_job_id":"4bff8d24-7ac9-49a8-a1d2-1cc9cbc69273","html_url":"https://github.com/Fabi019/hid-barcode-scanner","commit_stats":{"total_commits":467,"total_committers":2,"mean_commits":233.5,"dds":"0.18843683083511775","last_synced_commit":"e84a92f17ea6ff4166b52757d2540a603196e019"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/Fabi019/hid-barcode-scanner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fabi019%2Fhid-barcode-scanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fabi019%2Fhid-barcode-scanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fabi019%2Fhid-barcode-scanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fabi019%2Fhid-barcode-scanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fabi019","download_url":"https://codeload.github.com/Fabi019/hid-barcode-scanner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fabi019%2Fhid-barcode-scanner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28642695,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T18:04:35.752Z","status":"ssl_error","status_checked_at":"2026-01-21T18:03:55.054Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","barcode","bluetooth","jetpack-compose","kotlin","qrcode","scanner"],"created_at":"2026-01-21T21:01:08.469Z","updated_at":"2026-01-21T21:01:09.335Z","avatar_url":"https://github.com/Fabi019.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Fabi019/hid-barcode-scanner/actions/workflows/android.yml\"\u003e\u003cimg src=\"https://github.com/Fabi019/hid-barcode-scanner/actions/workflows/android.yml/badge.svg\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/Fabi019/hid-barcode-scanner/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/Fabi019/hid-barcode-scanner?include_prereleases\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://play.google.com/store/apps/details?id=dev.fabik.bluetoothhid\u0026pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1\"\u003e\u003cimg src=\"https://img.shields.io/endpoint?color=brightgreen\u0026logo=google-play\u0026logoColor=white\u0026url=https%3A%2F%2Fplay.cuzi.workers.dev%2Fplay%3Fi%3Ddev.fabik.bluetoothhid%26l%3DDownloads%26m%3D%24totalinstalls\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/Fabi019/hid-barcode-scanner/actions/workflows/test.yml\"\u003e\u003cimg src=\"https://github.com/Fabi019/hid-barcode-scanner/actions/workflows/test.yml/badge.svg\" /\u003e\u003c/a\u003e\n\n  \u003cbr/\u003e\n  \u003cbr/\u003e\n\n  \u003cimg alt=\"App Logo\" src=\"app/src/main/ic_launcher-playstore.png\" width=\"100\" /\u003e\n\n  \u003ch1\u003eHID Barcode Scanner\u003c/h1\u003e\n\u003c/div\u003e\n\n\nAndroid app for scanning barcodes with the phone camera and sending them to a PC via bluetooth. No\nspecial software is required on the PC as this app uses the BluetoothHID API available on devices\nrunning Android 9 or greater.\n\n## Features\n\n- Supports a wide range of Linear and 2D-Codes thanks to\n  the [zxing-cpp](https://github.com/zxing-cpp/zxing-cpp) library\n- Doesn't require any internet connection\n- History feature that allows exporting the session as text, JSON or CSV\n- Multiple different keyboard layouts to choose from\n- Large amount of customization for different use-cases\n    - Extra keys like \\n or \\t\n    - Template engine to send additional special keys including modifier combinations\n    - Regex filtering of codes with support for capture group extraction\n    - JavaScript engine to implement custom logic based on the value and type\n    - Auto connect with last device\n    - Auto send on detection\n    - And much more\n\n## Screenshots\n\nDevice list and Scanner screen. If you don't want to connect with any device now and just want to\ntry out the scanner, pressing the 'Skip'-Button at the bottom of the paired devices will bring you\ndirectly to the scanner.\n\nOtherwise the app tries to connect with the selected device and automatically sends you to the\nscanner once connected.\n\n\u003cimg alt=\"Devices\" src=\"img/devices.png\" width=\"200px\" /\u003e \u003cimg alt=\"Main\" src=\"img/main.png\" width=\"200px\" /\u003e\n\nAll configurable Settings. *(Newer versions might contain more or less settings as shown in the\npictures)*\n\n\u003cimg alt=\"Settings\" src=\"img/settings1.png\" width=\"200px\" /\u003e \u003cimg alt=\"Settings\" src=\"img/settings2.png\" width=\"200px\" /\u003e\n\n## Download\n\n\u003ca href='https://play.google.com/store/apps/details?id=dev.fabik.bluetoothhid\u0026pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'\u003e\u003cimg alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png' width='200px'/\u003e\u003c/a\u003e\n\n\u003e **Note**\u003c/br\u003e\n\u003e Because the version on the Play Store is usually one or two versions behind the latest release,\n\u003e you can also download the latest APKs directly here on GitHub as explained in the next section\n\n### Download as APK\n\nYou can either download the latest stable version from\nthe [Releases](https://github.com/Fabi019/hid-barcode-scanner/releases) tab or directly from\nthe [CI](https://github.com/Fabi019/hid-barcode-scanner/actions/workflows/test.yml) using the links\nbelow. Please note that the CI version might be unstable and that the builds are not signed (debug\nbuilds), thus requiring you to install them on your phone using *ADB*. The download links below\nare using *nightly.link* to provide the files because GitHub doesn't allow to download files from\nactions without being logged in.\n\n- Latest APKs (Release): [here](https://github.com/Fabi019/hid-barcode-scanner/releases/latest)\n- Latest\n  APK (\n  Debug): [here](https://nightly.link/Fabi019/hid-barcode-scanner/workflows/test/main/APK%28s%29%20debug%20generated.zip)\n\n## Troubleshooting\n\nIf you are unable to connect with a device you can try either of the steps below depending on how\nthe app behaves.\nIf these don't help, feel free to open a new issue and describe your problem in detail.\n\n### Connection dialog visible, but no connection possible\n\nThis is most likely caused because the phone was paired with the PC previously and now doesn't\naccept a new type of connection request.\n\n***Solution:***\n\n1. Make sure to first unpair the PC on the phone either from within the app or from the system\n   Bluetooth settings\n2. Remove the phone from the PC device list.\n   On Windows you can either do this through the device manager (look under the Bluetooth category)\n   and choose *Uninstall Device* or using the device list in the settings app.\n3. In the app now search for new devices and click on the target PC (This step could be important so\n   that the phone can tell the PC the new device type)\n4. A pairing request should show up and you may need to confirm a pin on both sides\n5. After that the connection should be successfully established\n\n### Nothing happens when clicking on a device\n\nIf there is not even a connection dialog when clicking on a device. This means that the registered\nBluetooth proxy was interrupted. Normally it should be connected again right away but in some cases\nthis might not happen.\n\n***Solution:***\n\nRestart the app. When launching again, there should be a small message at the bottom of the screen\nthat says the Bluetooth proxy was successfully connected. Otherwise you may have to restart your\ndevice. This could also mean that your device does not support the Bluetooth HID profile. To test\nthis, search for the app \"Bluetooth HID Profile Tester\" in the PlayStore and see what the result is.\nIf the test is not successful, unfortunately your device is not supported.\n\n## Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open a new issue with the tag \"enhancement\".\n\n1. Fork the Project\n2. Clone/Open the Repository in Android Studio\n3. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n4. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n5. Push to the Branch (`git push origin feature/AmazingFeature`)\n6. Open a Pull Request\n\n### Adding new keyboard layout\n\nWhen the app sends a code to the connected device it doesn't send characters directly.\nInstead the app works by sending raw HID-codes to the connected device (The same way a USB-keyboard\nbehaves).\nIt is then up to the connected device to interpret this HID-code depending on the layout that is\ncurrently selected in the OS.\nThis means, that if a scanned barcode contains the character 'Z', the app needs to know the keyboard\nlayout that the host PC expects (QWERTZ/QWERTY) to send the right HID-code that result in that\ncharacter.\nTo solve this the layout in the app must match the selected layout in the PC.\n\nThe app already implements a basic set of keyboard layouts to choose from.\nIf you want to add a new keyboard layout the following steps might help you:\n\n1. The first step is to create the actual keyboard layout file, for this a great guide already\n   exists in the layout for the [polish keyboard](app/src/main/assets/keymaps/pl.layout).\n   The layout file always consists of a list of characters with the hid code and modifier.\n2. Add the name of the layout to the `\u003cstring-array name=\"keyboard_layout_values\"\u003e` for every\n   available language under `app/src/main/res/values-*/strings.xml`\n3. Extend the switch case\n   in [BluetoothController.kt#sendString](app/src/main/java/dev/fabik/bluetoothhid/bt/BluetoothController.kt#L285).\n   The number is the index of the entry in the `keyboard_layout_values` and the value is the name of\n   the layout file without extension (usually two letters)\n\n## Connection Modes\n\nThe app supports two connection modes: **HID** (default) and **RFCOMM** (Serial Port Profile). While HID mode works immediately by emulating a keyboard, RFCOMM mode requires additional setup and may need software on your PC to receive data.\n\n### When to use RFCOMM mode\n\n- **Non-intrusive operation:** RFCOMM sends data invisibly in the background without interfering with the user's current work, while HID mode simulates keyboard input that can disrupt typing or active applications\n- When you need raw text data instead of keyboard input simulation\n- For integration with custom applications that read from COM ports\n- When HID mode doesn't work due to compatibility issues\n- **Professional barcode scanner replacement:** Many commercial barcode scanners use COM port mode to avoid interrupting the user's workflow\n\n### Setting up RFCOMM mode\n\n1. **Enable RFCOMM mode:**\n   - Open the app settings\n   - Change \"Connection Mode\" from \"HID Keyboard\" to \"RFCOMM (SPP)\"\n\n2. **Pair your devices:**\n   - Unpair your phone from PC (both sides) if previously connected\n   - Remove phone from PC Bluetooth device list\n   - In the app, search for devices and connect to your PC\n   - Confirm pairing on both devices\n\n3. **Verify COM port creation:**\n   - On Windows: Go to Device Manager → Ports (COM \u0026 LPT)\n   - You should see \"Standard Serial over Bluetooth link\" with a COM port number\n   - If not visible, try unpairing and re-pairing using the app\n\n4. **Receiving data on PC:**\n   - **Option A:** Use terminal software (PuTTY, RealTerm, Arduino IDE Serial Monitor)\n   - **Option B:** Write custom software to read from the COM port\n   - **Option C:** Use PowerShell: `[System.IO.Ports.SerialPort]::GetPortNames()` to list ports\n\n### Troubleshooting RFCOMM\n\n**No COM port appears:**\n- Unpair devices completely and re-pair using the app (not Windows settings)\n- Ensure \"RFCOMM (SPP)\" mode is selected before pairing\n- **Manual COM port management:** If automatic port creation fails:\n  1. Go to Windows Bluetooth settings → More Bluetooth options → COM Ports tab\n  2. Click \"Add\" → Select \"Outgoing\" port type\n  3. Choose your phone from device list → Select \"Barcode Scanner\" service\n  4. Click OK to create the COM port\n\n**Can't read data from COM port:**\n- Verify the correct COM port number in Device Manager\n- Check if another application is already using the port\n- For Bluetooth SPP, baud rate setting is usually ignored, but some software may require any value\n\n**Technical details:**\n- **Protocol:** Bluetooth SPP (Serial Port Profile)\n- **UUID:** `00001101-0000-1000-8000-00805F9B34FB`\n- **Data encoding:** UTF-8\n- **Connection:** Bidirectional (app can send and receive data)\n- **Baud rate:** Not applicable (Bluetooth protocol handles data transfer)\n\n**For developers:**\nSample Python code to read from RFCOMM:\n```python\nimport serial\nport = serial.Serial('COM3')  # Baud rate not needed for Bluetooth SPP\nwhile True:\n    data = port.readline().decode('utf-8').strip()\n    print(f\"Received: {data}\")\n```\n\nSample C# code using System.IO.Ports:\n```csharp\nusing System.IO.Ports;\n\nSerialPort port = new SerialPort(\"COM3\");\nport.Open();\nwhile (true) {\n    string data = port.ReadLine();\n    Console.WriteLine($\"Received: {data}\");\n}\n```\n\n**Recommended for C# developers:** [InTheHand.Net.Bluetooth](https://github.com/inthehand/32feet) library provides better Bluetooth support that allows You more robust connection handling compared to System.IO.Ports.\n\n**Custom RFCOMM implementations:** If you need to adapt the RFCOMM data transmission to simulate specific physical COM scanner behavior (custom protocols, special formatting, etc.), we're open to implementing these features. Please open an issue describing your use case.\n\n## License\n\nCopyright (C) 2023-2025 Fabi019\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n*Google Play and the Google Play logo are trademarks of Google LLC.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabi019%2Fhid-barcode-scanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabi019%2Fhid-barcode-scanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabi019%2Fhid-barcode-scanner/lists"}