ST25DV04KC NFC Example Code Using Go And Building For Android
  • Go 57.3%
  • Java 42.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-21 18:19:10 +03:00
android Initial ST25DV04KC NFC tester 2026-08-21 18:09:40 +03:00
go/app Improve text input UI and document repository 2026-08-21 18:19:10 +03:00
.gitignore Initial ST25DV04KC NFC tester 2026-08-21 18:09:40 +03:00
go.mod Initial ST25DV04KC NFC tester 2026-08-21 18:09:40 +03:00
go.sum Initial ST25DV04KC NFC tester 2026-08-21 18:09:40 +03:00
README.md Improve text input UI and document repository 2026-08-21 18:19:10 +03:00

ST25DV04KC NFC tester

Android NFC-V / ISO 15693 test application for the ST25DV04KC dynamic NFC tag.

  • The UI is written in Go with Gio.
  • Java is only the Android NFC transport layer.
  • The app reads NDEF text and writes text entered in the Go UI.

Project layout

go/app/main.go                         Go + Gio UI
android/app/src/main/AndroidManifest.xml NFC permission and app declaration
android/app/src/main/java/.../MainActivity.java Gio host + NFC event bridge
android/app/src/main/java/.../St25Dv04KC.java ST25DV04KC NFC-V/NDEF transport
android/*.gradle                       Android build configuration

Everything else is generated during compilation and is ignored by Git.

Requirements

  • Go 1.26 or newer
  • JDK 17
  • Android SDK, API 35
  • Android NDK (side-by-side installation)
  • Gradle 8.7 or newer available on PATH

Install the Go Android packager once:

go install gioui.org/cmd/gogio@v0.10.0

Ensure %USERPROFILE%\go\bin is on PATH, otherwise PowerShell will not find gogio.

Clone from any Git server

git clone https://git.regsens.com/regimantas/ST25DV04KC-NFC-Example.git
cd ST25DV04KC-NFC-Example

The repository does not depend on GitHub.

Publish to your Git server

Run this once from the project root:

git init
git add .
git commit -m "Initial ST25DV04KC NFC tester"
git branch -M main
git remote add origin https://git.regsens.com/regimantas/ST25DV04KC-NFC-Example.git
git push -u origin main

For later updates:

git add .
git commit -m "Describe your change"
git push

Build Android APK

Set your SDK paths if they are not already configured:

$env:ANDROID_HOME = 'C:\Android'
$env:ANDROID_NDK_HOME = 'C:\Android\ndk\26.1.10909125'

When the project is in OneDrive, use a temporary build directory outside OneDrive to avoid file locks:

$env:NFC_BUILD_DIR = 'C:\Temp\nfc-gio-build'
cd android
gradle :app:assembleDebug --no-daemon

APK output:

C:\Temp\nfc-gio-build\app\outputs\apk\debug\app-debug.apk

Without NFC_BUILD_DIR, the output is android/.build/app/outputs/apk/debug/app-debug.apk.

Install to a USB-connected Android phone:

adb install -r C:\Temp\nfc-gio-build\app\outputs\apk\debug\app-debug.apk

Build Windows UI

The same Gio UI can run on Windows. NFC is Android-only, so reading and writing tags will not work there.

go build -o st25dv-test.exe ./go/app
.\st25dv-test.exe

ST25DV04KC setup

The chip must be exposed as an NFC Forum Type 5 / NDEF tag and RF writing must not be locked. The app only accepts NFC-V / ISO 15693 tags.