All Projects → romellfudi → FudiNFC

romellfudi / FudiNFC

Licence: MIT License
💳 NFC Reader And Writer using Android devices by @romellfudi

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to FudiNFC

NFCReaderWriter
NFCReaderWriter which supports to read data from NFC chips(iOS 11), write data to NFC chips(iOS 13) and read NFC tags infos(iOS 13) by iOS devices. Compatible with both Swift and Objective-C. I will appreciate you if give me a star on the top right of page.
Stars: ✭ 58 (+31.82%)
Mutual labels:  nfc, nfc-card-reader, nfc-tag, nfc-writer, nfc-reader
TonUINO
Alternative TonUINO Firmware
Stars: ✭ 112 (+154.55%)
Mutual labels:  nfc, nfc-tag, nfc-reader
react-native-status-keycard
React Native library to interact with Status Keycard using NFC connection
Stars: ✭ 20 (-54.55%)
Mutual labels:  nfc, nfc-card-reader, nfc-tag
nfsee
Read your Transit/Bank/ID cards on Android/iOS phone with NFSee App
Stars: ✭ 80 (+81.82%)
Mutual labels:  nfc, nfc-tag, nfc-reader
flutter nfc kit
Flutter plugin to provide NFC functionality on Android and iOS, including reading metadata, read & write NDEF records, and transceive layer 3 & 4 data with NFC tags / cards
Stars: ✭ 119 (+170.45%)
Mutual labels:  nfc, nfc-tag
Margoulineur2000
NFC
Stars: ✭ 24 (-45.45%)
Mutual labels:  nfc, nfc-card-reader
nfc-tags
No description or website provided.
Stars: ✭ 15 (-65.91%)
Mutual labels:  nfc, nfc-tag
EasyNfc
[Android] A Android nfcLib
Stars: ✭ 30 (-31.82%)
Mutual labels:  nfc, nfc-card-reader
NFCAndroid
This is a project to using android HCE by using Type-4-Tag Message to working both in iOS and Android
Stars: ✭ 80 (+81.82%)
Mutual labels:  nfc, nfc-card-reader
nfc-laboratory
NFC signal and protocol analyzer using SDR receiver
Stars: ✭ 41 (-6.82%)
Mutual labels:  nfc, nfc-tag
SwiftyCodeView
Fully customizable UI Component for verification codes written in swift with RxSwift support!
Stars: ✭ 86 (+95.45%)
Mutual labels:  phone
Debt-Manager
A personal app to store people that owe you money or you owe money to. "Mo Money Mo Problems" 🎵 - The Notorious B.I.G. 😎
Stars: ✭ 22 (-50%)
Mutual labels:  android-architecture
PhoneVR
Use Steam VR-enabled applications with your phone as HMD (Head-mounted display). The only Open-Source solution to similar commercial packages like VRidge, iVRy, Trinus etc etc.
Stars: ✭ 178 (+304.55%)
Mutual labels:  phone
MobyDroid
Android Device Manager with a Graphic User Interface (GUI) – Manage Android on Linux, Windows and MacOS.
Stars: ✭ 76 (+72.73%)
Mutual labels:  phone
Katari
Katari - Python Session Initiated Protocol Framework
Stars: ✭ 29 (-34.09%)
Mutual labels:  phone
kozy-redux
Pure Kotlin redux library for Android.
Stars: ✭ 16 (-63.64%)
Mutual labels:  android-architecture
woapp
web模拟安卓操作系统,php开发,内置文件管理,电话,短信,拍照,用在树莓派上可做智能家居,视频监控,机顶盒等……
Stars: ✭ 22 (-50%)
Mutual labels:  phone
flutter-nfc
Flutter Android plugin for NFC
Stars: ✭ 14 (-68.18%)
Mutual labels:  nfc
FindTaek
📦 내가 시킨 택배가 어디까지 왔는지 확인해보세요
Stars: ✭ 26 (-40.91%)
Mutual labels:  android-architecture
0x4447 product answering machine
☎️ An automated answering machine build on top of Amazon Connect
Stars: ✭ 38 (-13.64%)
Mutual labels:  phone

Fudi NFC

Platform API License Bintray Data Studio Jitpack Android Arsenal

SNAPSHOT

Author Romell Domínguez

Downloads Dashboard

Data Studio

latestVersion is

Add the following in your app's build.gradle file:

repositories {
    maven { url 'https://jitpack.io' }
}
dependencies {
    implementation 'com.github.romellfudi:FudiNFC:1.1.0'
    // support for Android Nougat (API 31)
    implementation 'com.github.romellfudi:FudiNFC:android-12-1.1.0'
}

Add the following to your AndroidManifest.xml file :

<uses-permission android:name="android.permission.NFC" />

Now go to the created activity, and either

  • Implement the callback actions
// write email
OpCallback { it.writeEmailToTagFromIntent(text, null, null, intent) }

// write sms message
OpCallback { it.writeSmsToTagFromIntent(text, null, intent) }

// write geolocation - latitude & longitude
OpCallback { it.writeGeolocationToTagFromIntent(latitude, longitude, intent) } 

// write uri
OpCallback { it.writeUriToTagFromIntent(text, intent) }

// write phone contact
OpCallback { it.writeTelToTagFromIntent(text, intent) }

// write rolling-on bluetooth device
OpCallback { it.writeBluetoothAddressToTagFromIntent(text, intent) }

How to read tags

Paste this in the activity if you're extending our class :

override fun onNewIntent(Intent intent) {
    super.onNewIntent(intent) 
    for (String message in getNfcMessages()) { 
        // message 
    }
}
  • Otherwise :
override fun onNewIntent(intent: Intent?) {
    super.onNewIntent(intent)
    val items: SparseArray<String> = NfcReadUtilityImpl().readFromTagWithSparseArray(intent)
    for (i in 0 until items.size()) {
        // items.valueAt(i) 
    }
}
  • If you like the Map implementation more you might as well use :
override fun onNewIntent(intent: Intent?) {
    super.onNewIntent(intent)
    for (message in NfcReadUtilityImpl().readFromTagWithMap(intent).values()) {
        // message
    }
}
  • Now you're able to read the NFC Tags as long as the library supports the data in it when held to your phone!

How to write into tags

  • Let your activity implement TaskCallback:
fun onReturn(result: Boolean) {
    val message = if (result) "Success" else "Failed!"
    Toast.makeText(this, message, Toast.LENGTH_SHORT).show()
}

fun onProgressUpdate(vararg booleans: Boolean) {
    Toast.makeText(this, if (booleans[0]) "We started writing" else "We could not write!", Toast.LENGTH_SHORT).show()
}

fun onError(e: Exception) {
    Toast.makeText(this, e.message, Toast.LENGTH_SHORT).show()
}

How to obtain tags' MAC

fun getMAC(tag: Tag): String{
    val byteArrayToHexString = String.format("%0" + (tag.id.size * 2).toString() + "X", BigInteger(1, tag.id))
    val regex = Regex("(.{2})")
    return regex.replace(byteArrayToHexString, "$1:").dropLast(1)
}
  • If you hold a tag near by the phone and NFC is Enabled, your implementation of the methods will be executed.

MAD SCORE

summary

kotlin

nfc

License

Copyright 2020 Romell D.Z.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].