{"id":37026706,"url":"https://github.com/springcard/android-keyple","last_synced_at":"2026-01-14T03:06:54.278Z","repository":{"id":42129079,"uuid":"467170004","full_name":"springcard/android-keyple","owner":"springcard","description":"Keyple Plugin SpringCard Android PC/SC Like","archived":false,"fork":false,"pushed_at":"2024-06-05T07:38:43.000Z","size":470,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-05T10:17:55.366Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/springcard.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-07T16:20:23.000Z","updated_at":"2024-06-05T07:33:57.000Z","dependencies_parsed_at":"2022-08-12T07:21:01.344Z","dependency_job_id":null,"html_url":"https://github.com/springcard/android-keyple","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/springcard/android-keyple","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springcard%2Fandroid-keyple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springcard%2Fandroid-keyple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springcard%2Fandroid-keyple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springcard%2Fandroid-keyple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/springcard","download_url":"https://codeload.github.com/springcard/android-keyple/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springcard%2Fandroid-keyple/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-01-14T03:06:53.702Z","updated_at":"2026-01-14T03:06:54.266Z","avatar_url":"https://github.com/springcard.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Keyple Plugin SpringCard PC/SC-like Android\n\n[![Kotlin](https://img.shields.io/badge/kotlin-1.4.20-blue.svg?logo=kotlin)](http://kotlinlang.org)\n[![KDoc link](https://img.shields.io/badge/API_reference-KDoc-blue)](https://springcard.github.io/android-keyple/)\n\n## Overview\n\nThe **Keyple Plugin SpringCard PC/SC-like Android** is an add-on to allow an application using Keyple to interact with [SpringCard](https://www.springcard.com) PC/SC readers in Android.\n\nThe physical link can be either USB or Bluetooth Low Energy.\n\n## Setup\n\nHere are the necessary dependencies to declare in your project to integrate this library:\n\n### Gradle Groovy\n```groovy\nimplementation 'org.calypsonet.terminal:calypsonet-terminal-reader-java-api:1.0.+'\nimplementation 'org.eclipse.keyple:keyple-common-java-api:2.0.+'\nimplementation 'org.eclipse.keyple:keyple-util-java-lib:2.+'\nimplementation 'org.eclipse.keyple:keyple-service-java-lib:2.0.1'\nimplementation 'com.springcard.keyple:keyple-plugin-springcard-android-pcsclike-java-lib:1.0.0'\n```\n\n### Gradle Kotlin\n```kotlin\nimplementation(\"org.calypsonet.terminal:calypsonet-terminal-reader-java-api:1.0.+\")\nimplementation(\"org.eclipse.keyple:keyple-common-java-api:2.0.+\")\nimplementation(\"org.eclipse.keyple:keyple-util-java-lib:2.+\")\nimplementation(\"org.eclipse.keyple:keyple-service-java-lib:2.0.1\")\nimplementation(\"com.springcard.keyple:keyple-plugin-springcard-android-pcsclike-java-lib:1.0.0\")\n```\n\n### Maven\n```mvn\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.calypsonet.terminal\u003c/groupId\u003e\n  \u003cartifactId\u003ecalypsonet-terminal-reader-java-api\u003c/artifactId\u003e\n  \u003cversion\u003e[1.0.0,1.1.0)\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.eclipse.keyple\u003c/groupId\u003e\n  \u003cartifactId\u003ekeyple-common-java-api\u003c/artifactId\u003e\n  \u003cversion\u003e[2.0.0,2.1.0)\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.eclipse.keyple\u003c/groupId\u003e\n  \u003cartifactId\u003ekeyple-util-java-lib\u003c/artifactId\u003e\n  \u003cversion\u003e[2.0.0,3.0.0)\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.eclipse.keyple\u003c/groupId\u003e\n  \u003cartifactId\u003ekeyple-service-java-lib\u003c/artifactId\u003e\n  \u003cversion\u003e2.0.1\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.springcard.keyple\u003c/groupId\u003e\n  \u003cartifactId\u003ekeyple-plugin-springcard-android-pcsclike-java-lib\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Initialization of the plugin\nThe first thing to do to use this plugin is to get a factory with [AndroidPcsclikePluginFactoryProvider] by providing it with\n- the type of device ([AndroidPcsclikePluginFactory.DeviceType]),\n- the Android context.\n\n```kotlin\n// initialization\npluginFactory = AndroidPcsclikePluginFactoryProvider.getFactory(AndroidPcsclikePluginFactory.DeviceType.USB, activity)\n// registration\nandroidPcsclikePlugin = smartCardService.registerPlugin(pluginFactory) as ObservablePlugin\n```\n\n## Register and observe\nSubmit the obtained factory to the smart card service of Keyple and get back the plugin.\n\u003cbr\u003e\nBecome an observer of the plugin to retrieve the readers from the events generated during their connection.\n```kotlin\n// set up observation\nandroidPcsclikePlugin.setPluginObservationExceptionHandler(this)\nandroidPcsclikePlugin.addObserver(this)\n```\n\n## Reader discovery\n\nStart the device scanning with [AndroidPcsclikePlugin.scanDevices].\n\u003cbr\u003e\nHandle the result received by the class implementing *DeviceScannerSpi*.\n```kotlin\n// discover readers\nandroidPcsclikePlugin\n    .getExtension(AndroidPcsclikePlugin::class.java)\n    .scanDevices(2, true, this)\n\noverride fun onDeviceDiscovered(deviceInfoList: MutableCollection\u003cDeviceInfo\u003e) {\n    // connect to first discovered device\n    if (deviceInfoList.isNotEmpty()) {\n      val device = deviceInfoList.first()\n      androidPcsclikePlugin\n          .getExtension(AndroidPcsclikePlugin::class.java)\n          .connectToDevice(device.identifier)\n    } else {\n        // handle empty list\n    }\n}\n```\n\nBecome an observer of the needed reader.\n\n```kotlin\noverride fun onPluginEvent(pluginEvent: PluginEvent?) {\n    if (pluginEvent != null) {\n        if (pluginEvent.type == PluginEvent.Type.READER_CONNECTED) {\n            // connect to the reader identified by its name\n            for (readerName in pluginEvent.readerNames) {\n                if (readerName.toUpperCase().contains(\"CONTACTLESS\")) {\n                    cardReader = androidPcsclikePlugin.getReader(readerName) as ObservableReader\n                    if (cardReader != null) {\n                        cardReader!!.getExtension(AndroidPcscReader::class.java)\n                            .setContactless(true)\n                        cardReader!!.setReaderObservationExceptionHandler { pluginName, readerName, e -\u003e\n                            // handle plugin observation exception here\n                        }\n                        cardReader!!.addObserver(this)\n                        cardReader!!.startCardDetection(ObservableCardReader.DetectionMode.REPEATING)\n                        // prepare scheduled selection here        \n                    }\n                }\n            }\n            if (pluginEvent.type == PluginEvent.Type.READER_DISCONNECTED) {\n                for (readerName in pluginEvent.readerNames) {\n                    // notify reader disconnection\n                }\n            }\n        }\n    }\n}\n```\n\n## Example application\n\nAn example of implementation is available in the **example-app** folder.\n\nThis example implements the plugin with the choice of USB or BLE mode.\n\nThe card scenario corresponds to a Calypso transaction with or without SAM.\n\nIt has been tested with SpringCard readers [Puck One](https://www.springcard.com/fr/products/puck-one) et [Puck Blue](https://www.springcard.com/fr/products/puck-blue)\n\n## About the source code\n\nThe code is built with **Gradle** and is compliant with **Java 1.8** in order to address a wide range of applications.\n\nThe formatting of the code is kept clean by [spotless](https://github.com/diffplug/spotless).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringcard%2Fandroid-keyple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspringcard%2Fandroid-keyple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringcard%2Fandroid-keyple/lists"}