Android Code to read and write NFC Tags
https://www.learn2crack.com/2016/10/android-reading-and-writing-nfc-tags.html
Android Code to read and write NFC Tags
License: MIT License
Android Code to read and write NFC Tags
https://www.learn2crack.com/2016/10/android-reading-and-writing-nfc-tags.html
Would be (more) awesome if it had the feature of setting and removing the 32 bit password (ntag213, mifare ultralight, etc) on the writing operation.. Haven't find a decent demo for it yet
Can you help me sorting this out? I'm posting the logcat:
When I try to read a TAG:
05-14 10:28:40.385 13786-13786/? V/Zygote: Switching descriptor 40 to /dev/null
Switching descriptor 10 to /dev/null
05-14 10:28:40.385 13786-13786/? D/dalvikvm: Late-enabling CheckJNI
05-14 10:28:40.505 13786-13786/com.learn2crack.nfc I/dalvikvm: Could not find method android.view.Window$Callback.onProvideKeyboardShortcuts, referenced from method android.support.v7.view.WindowCallbackWrapper.onProvideKeyboardShortcuts
05-14 10:28:40.505 13786-13786/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve interface method 15848: Landroid/view/Window$Callback;.onProvideKeyboardShortcuts (Ljava/util/List;Landroid/view/Menu;I)V
05-14 10:28:40.505 13786-13786/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x72 at 0x000c
05-14 10:28:40.505 13786-13786/com.learn2crack.nfc W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;)
05-14 10:28:40.505 13786-13786/com.learn2crack.nfc I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested
05-14 10:28:40.505 13786-13786/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve interface method 15850: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z
05-14 10:28:40.505 13786-13786/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x72 at 0x0007
05-14 10:28:40.505 13786-13786/com.learn2crack.nfc I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode
05-14 10:28:40.505 13786-13786/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve interface method 15854: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
05-14 10:28:40.505 13786-13786/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x72 at 0x0009
05-14 10:28:40.505 13786-13786/com.learn2crack.nfc I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations
05-14 10:28:40.505 13786-13786/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve virtual method 462: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
05-14 10:28:40.505 13786-13786/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x6e at 0x0004
05-14 10:28:40.505 13786-13786/com.learn2crack.nfc I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType
05-14 10:28:40.505 13786-13786/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve virtual method 484: Landroid/content/res/TypedArray;.getType (I)I
05-14 10:28:40.505 13786-13786/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x6e at 0x0020
05-14 10:28:40.555 13786-13786/com.learn2crack.nfc I/dalvikvm: Could not find method android.widget.FrameLayout.startActionModeForChild, referenced from method android.support.v7.widget.ActionBarContainer.startActionModeForChild
05-14 10:28:40.555 13786-13786/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve virtual method 16282: Landroid/widget/FrameLayout;.startActionModeForChild (Landroid/view/View;Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
05-14 10:28:40.555 13786-13786/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x6f at 0x0016
05-14 10:28:40.555 13786-13786/com.learn2crack.nfc I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method android.support.v7.content.res.AppCompatResources.getColorStateList
05-14 10:28:40.555 13786-13786/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve virtual method 275: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList;
05-14 10:28:40.555 13786-13786/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x6e at 0x0029
05-14 10:28:40.565 13786-13786/com.learn2crack.nfc I/dalvikvm: Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawable
05-14 10:28:40.565 13786-13786/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve virtual method 425: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-14 10:28:40.565 13786-13786/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x6e at 0x0009
05-14 10:28:40.565 13786-13786/com.learn2crack.nfc I/dalvikvm: Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawableForDensity
05-14 10:28:40.565 13786-13786/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve virtual method 427: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-14 10:28:40.565 13786-13786/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x6e at 0x000b
05-14 10:28:40.575 13786-13786/com.learn2crack.nfc E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
05-14 10:28:40.575 13786-13786/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve instanceof 142 (Landroid/graphics/drawable/RippleDrawable;) in Landroid/support/v7/widget/AppCompatImageHelper;
05-14 10:28:40.575 13786-13786/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x20 at 0x0011
05-14 10:28:40.775 13786-13786/com.learn2crack.nfc I/Adreno-EGL: <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LNX.LA.3.5.1_RB1.04.04.04.048.065_msm8226_LNX.LA.3.5.1_RB1__release_AU ()
OpenGL ES Shader Compiler Version: E031.24.00.15
Build Date: 06/30/14 Mon
Local Branch:
Remote Branch: quic/LNX.LA.3.5.1_RB1.2
Local Patches: NONE
Reconstruct Branch: AU_LINUX_ANDROID_LNX.LA.3.5.1_RB1.04.04.04.048.065 + NOTHING
05-14 10:28:40.925 13786-13786/com.learn2crack.nfc D/OpenGLRenderer: Enabling debug mode 0
05-14 10:28:41.015 13786-13786/com.learn2crack.nfc I/Activity_Manager: Timeline: Activity_idle id: android.os.BinderProxy@41edb768 time:2159919
05-14 10:28:41.255 13786-13786/com.learn2crack.nfc I/Activity_Manager: Timeline: Activity_idle id: android.os.BinderProxy@41edb768 time:2160151
05-14 10:28:50.745 13786-13786/com.learn2crack.nfc I/dalvikvm: Could not find method android.app.DialogFragment.onAttach, referenced from method com.learn2crack.nfc.NFCReadFragment.onAttach
05-14 10:28:50.745 13786-13786/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve virtual method 109: Landroid/app/DialogFragment;.onAttach (Landroid/content/Context;)V
05-14 10:28:50.745 13786-13786/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x6f at 0x0002
05-14 10:28:51.895 13786-13786/com.learn2crack.nfc D/MainActivity: onNewIntent: android.nfc.action.TAG_DISCOVERED
05-14 10:28:54.385 13786-13786/com.learn2crack.nfc W/InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
05-14 10:28:54.405 13786-13786/com.learn2crack.nfc D/AndroidRuntime: Shutting down VM
05-14 10:28:54.405 13786-13786/com.learn2crack.nfc W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x416add88)
05-14 10:28:54.405 13786-13786/com.learn2crack.nfc E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.learn2crack.nfc, PID: 13786
java.lang.NullPointerException
at com.learn2crack.nfc.NFCReadFragment.onDetach(NFCReadFragment.java:54)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1017)
at android.app.FragmentManagerImpl.removeFragment(FragmentManager.java:1167)
at android.app.BackStackRecord.run(BackStackRecord.java:654)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:443)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5124)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:613)
at dalvik.system.NativeStart.main(Native Method)
05-14 10:28:56.675 13786-13786/com.learn2crack.nfc I/Process: Sending signal. PID: 13786 SIG: 9
When I try to write a TAG:
05-14 10:30:02.635 14159-14159/? V/Zygote: Switching descriptor 40 to /dev/null
Switching descriptor 10 to /dev/null
05-14 10:30:02.635 14159-14159/? D/dalvikvm: Late-enabling CheckJNI
05-14 10:30:02.715 14159-14159/com.learn2crack.nfc I/dalvikvm: Could not find method android.view.Window$Callback.onProvideKeyboardShortcuts, referenced from method android.support.v7.view.WindowCallbackWrapper.onProvideKeyboardShortcuts
05-14 10:30:02.715 14159-14159/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve interface method 15848: Landroid/view/Window$Callback;.onProvideKeyboardShortcuts (Ljava/util/List;Landroid/view/Menu;I)V
05-14 10:30:02.715 14159-14159/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x72 at 0x000c
05-14 10:30:02.715 14159-14159/com.learn2crack.nfc W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;)
05-14 10:30:02.715 14159-14159/com.learn2crack.nfc I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested
05-14 10:30:02.715 14159-14159/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve interface method 15850: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z
05-14 10:30:02.715 14159-14159/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x72 at 0x0007
05-14 10:30:02.715 14159-14159/com.learn2crack.nfc I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode
05-14 10:30:02.715 14159-14159/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve interface method 15854: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
05-14 10:30:02.715 14159-14159/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x72 at 0x0009
05-14 10:30:02.715 14159-14159/com.learn2crack.nfc I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations
05-14 10:30:02.715 14159-14159/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve virtual method 462: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
05-14 10:30:02.715 14159-14159/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x6e at 0x0004
05-14 10:30:02.715 14159-14159/com.learn2crack.nfc I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType
05-14 10:30:02.715 14159-14159/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve virtual method 484: Landroid/content/res/TypedArray;.getType (I)I
05-14 10:30:02.715 14159-14159/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x6e at 0x0020
05-14 10:30:02.745 14159-14159/com.learn2crack.nfc I/dalvikvm: Could not find method android.widget.FrameLayout.startActionModeForChild, referenced from method android.support.v7.widget.ActionBarContainer.startActionModeForChild
05-14 10:30:02.755 14159-14159/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve virtual method 16282: Landroid/widget/FrameLayout;.startActionModeForChild (Landroid/view/View;Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
05-14 10:30:02.755 14159-14159/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x6f at 0x0016
05-14 10:30:02.755 14159-14159/com.learn2crack.nfc I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method android.support.v7.content.res.AppCompatResources.getColorStateList
05-14 10:30:02.755 14159-14159/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve virtual method 275: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList;
05-14 10:30:02.755 14159-14159/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x6e at 0x0029
05-14 10:30:02.765 14159-14159/com.learn2crack.nfc I/dalvikvm: Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawable
05-14 10:30:02.765 14159-14159/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve virtual method 425: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-14 10:30:02.765 14159-14159/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x6e at 0x0009
05-14 10:30:02.765 14159-14159/com.learn2crack.nfc I/dalvikvm: Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawableForDensity
05-14 10:30:02.765 14159-14159/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve virtual method 427: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-14 10:30:02.765 14159-14159/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x6e at 0x000b
05-14 10:30:02.775 14159-14159/com.learn2crack.nfc E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
05-14 10:30:02.775 14159-14159/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve instanceof 142 (Landroid/graphics/drawable/RippleDrawable;) in Landroid/support/v7/widget/AppCompatImageHelper;
05-14 10:30:02.775 14159-14159/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x20 at 0x0011
05-14 10:30:02.865 14159-14159/com.learn2crack.nfc I/Adreno-EGL: <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LNX.LA.3.5.1_RB1.04.04.04.048.065_msm8226_LNX.LA.3.5.1_RB1__release_AU ()
OpenGL ES Shader Compiler Version: E031.24.00.15
Build Date: 06/30/14 Mon
Local Branch:
Remote Branch: quic/LNX.LA.3.5.1_RB1.2
Local Patches: NONE
Reconstruct Branch: AU_LINUX_ANDROID_LNX.LA.3.5.1_RB1.04.04.04.048.065 + NOTHING
05-14 10:30:02.885 14159-14159/com.learn2crack.nfc D/OpenGLRenderer: Enabling debug mode 0
05-14 10:30:02.975 14159-14159/com.learn2crack.nfc I/Activity_Manager: Timeline: Activity_idle id: android.os.BinderProxy@41edde18 time:2241870
05-14 10:30:17.515 14159-14159/com.learn2crack.nfc I/dalvikvm: Could not find method android.app.DialogFragment.onAttach, referenced from method com.learn2crack.nfc.NFCWriteFragment.onAttach
05-14 10:30:17.515 14159-14159/com.learn2crack.nfc W/dalvikvm: VFY: unable to resolve virtual method 109: Landroid/app/DialogFragment;.onAttach (Landroid/content/Context;)V
05-14 10:30:17.525 14159-14159/com.learn2crack.nfc D/dalvikvm: VFY: replacing opcode 0x6f at 0x0002
05-14 10:30:18.715 14159-14159/com.learn2crack.nfc D/MainActivity: onNewIntent: android.nfc.action.TAG_DISCOVERED
05-14 10:30:21.775 14159-14159/com.learn2crack.nfc W/InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
05-14 10:30:21.795 14159-14159/com.learn2crack.nfc D/AndroidRuntime: Shutting down VM
05-14 10:30:21.795 14159-14159/com.learn2crack.nfc W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x416add88)
05-14 10:30:21.805 14159-14159/com.learn2crack.nfc E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.learn2crack.nfc, PID: 14159
java.lang.NullPointerException
at com.learn2crack.nfc.NFCWriteFragment.onDetach(NFCWriteFragment.java:57)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1017)
at android.app.FragmentManagerImpl.removeFragment(FragmentManager.java:1167)
at android.app.BackStackRecord.run(BackStackRecord.java:654)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:443)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5124)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:613)
at dalvik.system.NativeStart.main(Native Method)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.