-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NDef Reader and Writer Demos Fail with the Following Stack Trace: #2
Comments
i'm getting the same error. which is Mad1 extends AbstractMad public AbstractMad(MfClassicReaderWriter readerWriter, MadKeyConfig keyConfig) { so, if when you run NdefReaderDemo and NdefWriter demo, they will really throw you to that exception. i dont really know the work around here i just traced the code and i can say that NdefReader and NdefWriter Demos will not work how many times you will try. is there a way to make this work @grundid ? |
I know this is many years late, but for others banging their head against the wall: It's a deprecated API. The new API usage looks like this (in Kotlin): val adapter = NfcAdapter(getAvailableTerminal(), TerminalMode.INITIATOR, object : TagScannerListener{
override fun onScanningEnded() {
println("onScanningEnded")
}
override fun onScanningFailed(throwable: Throwable?) {
println("onScanningFailed")
}
override fun onTagHandingFailed(throwable: Throwable?) {
println("onTagHandingFailed")
}
})
adapter.registerTagListener(MfClassicNfcTagListener(object : NdefOperationsListener{
override fun onNdefOperations(ndefOperations: NdefOperations) {
val records = ndefOperations.readNdefMessage()
for(record in records){
println("Record found: " + record.toString())
}
}
})) |
Thank you this solution solved my problem |
The text was updated successfully, but these errors were encountered: