card.io-Android-source
Описание
The open-source code for the card.io-Android-SDK: provides fast, easy credit card scanning in mobile apps
Языки
- Java72%
- CMake21,4%
- C++4,4%
- Shell1,5%
- Makefile0,7%
Card IO Fork
This repo is a fork of the original Card IO Android SDK Source Code.
The main purpose being to fix the issues with Android 15, namely support for 16KB page size devices.
Building this forked version
- Clone this forked repo
- Open the cloned project in a terminal and init its
submodule:dmz. Until dmz code is merged, checkout branch https://github.com/OS-pedrogustavobilro/card.io-dmz/tree/fix/RMET-3602/android15-16kb-page-sizegit submodule sync; git submodule update --init --recursive - Open the project in Android Studio (used Android Studio Ladybug | 2024.2.1 Patch 2 on Mac)
- Install NDK 28 - Android Studio -> Tools -> SDK Manager
- Open the project in Android Studio (used Android Studio Ladybug | 2024.2.1 Patch 2 on Mac)
- Download SDK 25 if you haven't already (In Android Studio -> Tools -> SDK Manager)
- Set the JDK version of the project to JDK 17.
- If you are on a MAC OS and Apple is blocking NDK binaries, go to the folder where NDK is installed and run in a terminal
; then open Mac's Settings – Privacy and Security – Allow Applications from – Anywheresudo spctl --master-disable - You should now be able to sync and build the card-io SDK -> ./gradlew assembleRelease
- Aar file in card.io/build/outputs/aar
Open CV
The Open CV library's most recent version, 4.10.0, does not support 16KB page sizes. See https://github.com/opencv/opencv/issues/26027
So we built it from source using the branch from https://github.com/opencv/opencv/pull/26057.
Because OpenCV's build script generates an .so file for the entire library (increases the apk size by too much), but we only want a few modules, we use the script at [opencv/build_opencv_16kb.sh]
Credit card scanning for Android apps
This repository contains everything needed to build the card.io library for Android.
What it does not yet contain is much in the way of documentation. 😿 So please feel free to ask any questions by creating github issues -- we'll gradually build our documentation based on the discussions there.
Note that this is actual production code, which has been iterated upon by multiple developers over several years. If you see something that could benefit from being tidied up, rewritten, or otherwise improved, your Pull Requests will be welcome! See CONTRIBUTING.md for details.
Using card.io
If you merely wish to incorporate card.io within your Android app, simply download the latest official release from https://github.com/card-io/card.io-Android-SDK. That repository includes complete integration instructions and sample code.
Dev Setup
Prerequisites
- Current version of the Android SDK. (obviously)
- Android NDK. We've tested with r10e. At minimum, the Clang toolchain is required.
First build
There are a few bugs in the build process, so these steps are required for the first build:
- clone this repo
- $ cd card.io-Android-source
- init its
submodule:dmzgit submodule sync; git submodule update --init --recursive - $ cp local.properties.example local.properties
- Edit
with your env (Assuming you've definedlocal.propertiescorrectly, run$ANDROID_NDK$ echo "$ANDROID_NDK" "$ANDROID_SDK" - $ ./gradlew clean assembleDebug
Hints & tricks.
- See card.io/src/main/jni for native layer (NDK) discussion.
Testing
Running
- Connect an Android 18 (or better) device.
- $ ./gradlew connectedAndroidTest
You should see the app open and run through some tests.
Un-official Release
Cleans and builds an aar file for distribution.
The official release process is described separately.
Contributors
card.io was created by Josh Bleecher Snyder.
Subsequent help has come from Brent Fitzgerald, Tom Whipple, Dave Goldman, Jeff Brateman, Roman Punskyy, Matt Jacunski, Dan Nizri, and Zach Sweigart.
And from you! Pull requests and new issues are welcome. See CONTRIBUTING.md for details.

