{"id":44777962,"url":"https://github.com/tillhub/scan-engine","last_synced_at":"2026-02-16T07:13:04.670Z","repository":{"id":43825431,"uuid":"459124731","full_name":"tillhub/scan-engine","owner":"tillhub","description":"Library which combines Pax, Sunmi \u0026 MLKit for scanning engine.","archived":false,"fork":false,"pushed_at":"2025-10-06T08:36:44.000Z","size":914,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-06T10:27:42.642Z","etag":null,"topics":["android","library"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tillhub.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-02-14T10:56:56.000Z","updated_at":"2025-09-11T15:04:27.000Z","dependencies_parsed_at":"2024-03-04T12:47:02.072Z","dependency_job_id":"22f0ed38-fb56-4d9c-bb41-3e6aa6754272","html_url":"https://github.com/tillhub/scan-engine","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/tillhub/scan-engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tillhub%2Fscan-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tillhub%2Fscan-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tillhub%2Fscan-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tillhub%2Fscan-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tillhub","download_url":"https://codeload.github.com/tillhub/scan-engine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tillhub%2Fscan-engine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29502933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T05:57:17.024Z","status":"ssl_error","status_checked_at":"2026-02-16T05:56:49.929Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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","library"],"created_at":"2026-02-16T07:13:02.519Z","updated_at":"2026-02-16T07:13:04.664Z","avatar_url":"https://github.com/tillhub.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![](https://jitpack.io/v/tillhub/scan-engine.svg)](https://jitpack.io/#tillhub/scan-engine)\n[![API](https://img.shields.io/badge/API-24%2B-green.svg?style=flat)](https://android-arsenal.com/api?level-11)\n# Scan Engine\n\nThis library combines various scanning protocols into a single, easy-to-use interface.\n\n# How to setup\n\n**Step 1.** Add the JitPack repository to your `settings.gradle` file:\n\n```groovy\ndependencyResolutionManagement {\n    repositories {\n        ...\n        mavenCentral()\n\t\tmaven { url 'https://jitpack.io' }\n    }\n}\n```\n\n**Step 2.** Add the dependency to your app `build.gradle`:\n```groovy\ndependencies {\n    implementation 'com.github.tillhub:scan-engine:x.x.x'\n}\n```\n# Usage\n\nThis SDK offers two ways to scan products conveniently:\n* `Camera scanner(SunmiScanner/DefaultScanner)` : Manually register an activity or fragment result callback.\n* `Barcode scanner(BarcodeScannerImpl)` : Register a BroadcastReceiver with the barcode scanner.\n\n### 1. Camera Scanner :\n\n*  `Singleton Access`: Obtain a singleton reference to the `ScanEngine` instance.\n*  `Initialization`: Create a per Activity or Fragment Scanner instance. SDK will automatically selects the appropriate scanner based on the device manufacturer (SunmiScanner or DefaultScanner).\n*  `Initiate Scan`: Call `scanner.startCameraScanner()` to initiate scanning. Pass appropriate scan key if needed, by default its null.\n*  `Handle Scan Results`: Subscribe to the `scanEngine.observeScannerResults()` flow to receive ScanEvent objects containing scan data.\n\n```kotlin\n\noverride fun onCreate(savedInstanceState: Bundle?) {\n    // ...\n    \n    val scanEngine =  ScanEngine.getInstance(context)\n    val scanner = scanEngine.newCameraScanner(this)\n    \n    scannerButton.setOnClickListener {\n        scanner.startCameraScanner()\n    }\n\n    // Observing scan result with scanEngine\n    scanEngine.observeScannerResults().collect { scanEvent -\u003e\n         // Handle scanEvent result\n    }\n}\n```\n\nHere's example of `Scanner` interface:\n\n```kotlin\ninterface Scanner {\n    fun observeScannerResults(): StateFlow\u003cScanEvent\u003e\n    fun startCameraScanner(scanKey: String? = null)\n}\n```\n\n### 2. Barcode Scanner :\n\n*  `Singleton Access`: Obtain a singleton reference to the `ScanEngine` instance. This will trigger a background scan using the system's broadcast mechanism.\n*  `Handle Scan Results`: Subscribe to `scanEngine.observeScannerResults()` for ScanEvent objects  containing scan data.\n\n```kotlin\n\noverride fun onCreate(savedInstanceState: Bundle?) {\n    // ...\n    \n    val scanEngine =  ScanEngine.getInstance(context)\n    \n    // Observing scan result with scanEngine\n    scanEngine.observeScannerResults().collect { scanEvent -\u003e\n        // Handle scanEvent result\n    }\n    \n}\n```\n\nHere's example of `BarcodeScanner` interface:\n\n```kotlin\ninterface BarcodeScanner {\n    fun observeScannerResults(): Flow\u003cScanEvent\u003e\n    fun scanWithKey(scanKey: String? = null)\n}\n```\n\n## Credits\n\n- [Đorđe Hrnjez](https://github.com/djordjeh)\n- [Martin Širok](https://github.com/SloInfinity)\n- [Chandrashekar Allam](https://github.com/shekar-allam)\n\n## License\n\n```licence\nMIT License\n\nCopyright (c) 2024 Tillhub GmbH\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftillhub%2Fscan-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftillhub%2Fscan-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftillhub%2Fscan-engine/lists"}