Skip to content

mustafakibar/CardHolder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CardHolder

Android app for storing the user's payment cards locally and showing promotions/campaigns from the issuing bank. The user adds a card by scanning it with the device camera; the app looks up the bank from the card's BIN range, stores the card in a local Room database, and fetches campaign hits for the bank via Huawei Search Kit.

The UI is in Turkish; the app was built against the Huawei Mobile Services (HMS) SDK stack.

Features

  • Add a payment card via Huawei ML Kit's bank-card scanner (BCR).
  • Store cards in a local Room database (no cloud sync).
  • Resolve card issuer/organization from the card BIN via a REST lookup.
  • Show campaign search results for the selected card's bank via Huawei Search Kit.
  • Voice input entry point via Huawei ML Kit ASR (capture flow wired; the recognized text result is not yet consumed).
  • Carousel-style main screen for browsing stored cards.

Tech Stack

  • Android (minSdk 24, compileSdk 30, targetSdk 30)
  • Kotlin 1.5.20, Java 1.8 bytecode
  • Android Gradle Plugin 4.1.3, Gradle 6.5
  • Dagger Hilt 2.37 (DI)
  • AndroidX (AppCompat, Activity-KTX, Lifecycle, ConstraintLayout, Material)
  • Room 2.3.0 (local persistence)
  • Retrofit 2.9.0 + OkHttp logging interceptor + Gson (HTTP + JSON)
  • Kotlin Coroutines 1.5.0
  • Huawei Mobile Services: ML Kit (bank-card scanner, ASR), Search Kit, AGConnect
  • Timber for logging
  • com.github.sparrow007:carouselrecyclerview for the card carousel
  • com.vinaygaba:creditcardview for the credit-card UI component

Requirements

  • JDK 8 (source/target compatibility is set to 1.8)
  • Android SDK with platform 30 and build-tools 30.0.3
  • Huawei AppGallery Connect credentials (agconnect-services.json) — obtained from the Huawei AppGallery Connect console after registering the app; not included in this repo; place it under app/
  • A device or emulator with Huawei Mobile Services available for the HMS features

Installation

Note: the Gradle wrapper scripts (gradlew, gradlew.bat) are not checked in. Either open the project in Android Studio (which regenerates them on import), or run gradle wrapper --gradle-version 6.5 once with a local Gradle install before invoking the wrapper.

Open the project in Android Studio and let Gradle sync, or from the command line:

./gradlew assembleDebug

The built APK will be at app/build/outputs/apk/debug/.

To install on a connected device:

./gradlew installDebug

Configuration

  • agconnect-services.json — Huawei AGConnect service configuration for the app (excluded from version control).
  • local.properties — must contain sdk.dir pointing at your Android SDK (generated by Android Studio; excluded from version control).
  • app/cardholder.jks — release signing keystore (excluded from version control). Required only for release builds.

Permissions

The app declares the following permissions in app/src/main/AndroidManifest.xml:

  • CAMERA — bank-card scanner.
  • INTERNET — BIN lookup and Huawei Search Kit requests.
  • ACCESS_NETWORK_STATE — connectivity checks.
  • RECORD_AUDIO — ML Kit ASR voice input.
  • WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE — legacy external storage access.

Usage

Launch the app from the device's launcher. From the main screen:

  • Tap the add (+) menu item to open the Huawei bank-card scanner; point the camera at a physical card to capture its details.
  • Swipe through the carousel to browse previously added cards; tap delete to remove one.
  • When a card is selected, the bottom section shows campaign search results for the card's issuer bank.

SDK versions

minSdk 24 (Android 7.0)
targetSdk 30 (Android 11)
compileSdk 30
buildToolsVersion 30.0.3

Project Structure

CardHolder/
├── app/                     # Application module
│   └── src/main/
│       ├── AndroidManifest.xml
│       ├── java/kibar/cardholder/
│       │   ├── CardHolderApp.kt
│       │   ├── adapter/     # RecyclerView adapters (cards, search results)
│       │   ├── api/         # Retrofit services (BIN lookup, HMS auth)
│       │   ├── data/        # Repositories (bank cards, BIN, web search)
│       │   ├── db/          # Room database
│       │   ├── di/          # Hilt modules
│       │   ├── model/       # Data classes (BankCard, SearchResult, etc.)
│       │   ├── ui/          # Activities and view models
│       │   └── utils/       # Permission helpers, extensions
│       └── res/             # Layouts, drawables, strings (Turkish)
├── build.gradle             # Top-level Gradle config (classpaths)
├── settings.gradle
└── gradle/wrapper/          # Gradle 6.5 wrapper

License

MIT. See LICENSE.

About

Simple card scanning and viewing application with huawei ml kit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages