unable to run my nfc application - android

I m creating a sample Nfc application.. in GingerBread2.3.3 - which includes nfc features.. i have checked for the Nfc service running on the system bootup... the service runs perfectly on boot up...
I m using an external hardware to detect the Nfc tags... the hardware is fine... checked it also...
From my application, i have set permission for Nfc and I have included the Nfc feature also..
I found out that NfcAdapter.java - hasSystemFeature() is returning false for Nfc... but my Nfc service is running.... In settings, I don't get any Nfc related features.. On setting this hasSystemFeature() to return true. I get the Nfc settings. But my application does nothing..
I checked in current.xml whether it includes nfc features.. and it also has Nfc features..
Now I m struck not sure what to do.. Pls do help me out with this...

Related

NFC_manager flutter package reading NFC not work in android

I've followed 'NFC_manager' example, https://pub.dev/packages/nfc_manager/example
Successfully build in my android phone and check NFC instance avaiable when I turn on NFC mode.
Howerver, clicking the 'Tag Read' button, it should be started to scan NFC tags.
photo-1
But 'NFC_manager' cannot catch any tag.
After some time past, below error message appear in the text box as below photo.
photo-2
Is there anything else I missed?

Hide "NFC Tag type not supported" error on Samsung Galaxy devices

I am working on an app that scans just the UID of MIFARE Classic cards to facilitate attendance registration. I have got it working. However, every time I scan a card on my Galaxy S4, I get a toast stating "NFC tag type not supported".
I want to either block or hide that message while the app is open.
I noticed there was one other question asking for the same thing on a Galaxy S6 but it was down-voted once and then ignored.
I found this conversation on the Samsung Developers forum, however, I could not extract an answer from what is written there:
if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(intent.getAction())) {
myTag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
tagID = intent.getByteArrayExtra(NfcAdapter.EXTRA_ID);
alertDialog.dismiss();
It looks like the alertDialog.dismiss() section is what I need but there is no explanation for where they got the alertDialog object from.
Before Android 4.4
What you are trying to do is simply not possible from an app (at least not on a non-rooted/non-modified device). The message "NFC tag type not supported" is displayed by the Android system (or more specifically the NFC system service) before and instead of dispatching the tag to your app. This means that the NFC system service filters MIFARE Classic tags and never notifies any app about them. Consequently, your app can't detect MIFARE Classic tags or circumvent that popup message.
On a rooted device, you may be able to bypass the message using either
Xposed to modify the behavior of the NFC service, or
the CSC (Consumer Software Customization) feature configuration files on the system partition (see /system/csc/. The NFC system service disables the popup and dispatches MIFARE Classic tags to apps if the CSC feature <CscFeature_NFC_EnableSecurityPromptPopup> is set to any value but "mifareclassic" or "all". For instance, you could use:
<CscFeature_NFC_EnableSecurityPromptPopup>NONE</CscFeature_NFC_EnableSecurityPromptPopup>
You could add this entry to, for instance, the file "/system/csc/others.xml" (within the section <FeatureSet> ... </FeatureSet> that already exists in that file).
Since, you asked for the Galaxy S6 (the question that you linked) as well: I have tested this method on the S4 when it came out. I have not verified if this still works in the latest firmware or on other devices (e.g. the S6).
Since Android 4.4
This is pure guessing, but according to this (link no longer available), it seems that some apps (e.g. NXP TagInfo) are capable of detecting MIFARE Classic tags on affected Samsung devices since Android 4.4. This might mean that foreground apps are capable of bypassing that popup using the reader-mode API (see NfcAdapter.enableReaderMode) possibly in combination with NfcAdapter.FLAG_READER_SKIP_NDEF_CHECK.

Enable/Disable NFC with ADB command

Is there any way to disable/enable NFC via ADB shell commands?
I found one answer here.
What I tried from the above link:
# Enable NFC
service call nfc 5
# Disable NFC
service call nfc 4
but it's not working.
Any help appreciated. Thanks.
I don't know why no one has posted this already
svc nfc <enable|disable>
Works perfectly
Edit: Requires > Android 6.0
# Disable NFC
service call nfc 7
Verified for Android 8.0
Cheers!
In your DDMS of eclipse or using logfilter or any runtime log capturing tool, you need to get the process ID of your NFCService. Then you can kill or stop that process by giving the process ID.
System services' method codes may vary with Android versions. Therefore, before making a service's method call browse the AOSP sources.
Below is a summary of the NFC's enable/disable calls up to Android 5.1.1. Also keep in mind that (in the sources)
int FIRST_CALL_TRANSACTION = 0x00000001
,i.e. equals to 1.
Android 4.4 - Android 5.1.1:
# Disable NFC
service call nfc 5
# Enable NFC
service call nfc 6
Android 4.0.1 - Android 4.3.1:
# Disable NFC
service call nfc 4
# Enable NFC
service call nfc 5
Android 2.3.4 - Android 2.3.7:
# Disable NFC
service call nfc 18
# Enable NFC
service call nfc 19
Android 2.3.3:
# Disable NFC
service call nfc 20
# Enable NFC
service call nfc 21
Android 2.3.2:
# Disable NFC
service call nfc 13
# Enable NFC
service call nfc 14
To check the status of the NFC service use the dumpsys command:
dumpsys nfc
Please try this
# Enable NFC
service call nfc 6
# Disable NFC
service call nfc 5
please check here in slide no 32
For Android Version > 7, please use following -
# Enable NFC
service call nfc 7
# Disable NFC
service call nfc 6
Verified on 7.1.1... Should work for atleast 7.x

Start an Android App when an "unknown tag type" is scanned

I am working on an Android NFC reader project in which I use the AS3953 NFC chip. according to the datasheet: This NFC chip could be used
Where log data is stored periodically by the microcontroller and can
then be read by the PCD even when the microcontroller is not powered.
And this is exactly what I am trying to do, read passively the NFC tag. The problem is that my Android phone doesn't recognise the tag when it's not connected to the microcontroller. I have just a noise when I scan the tag and no information appear. I tried with another smartphone and I had the same behaviour with a small message: "unknown tag type".
My question is:
How can I start an Android App when an "unknown tag type" is detected. I tried the three Android intent handlers: TAG_DISCOVERED, TECH_DISCOVERED and NDEF_DSICOVERED, but none of these solutions has worked.
N.B: according to the datasheet, The AS3953A supports ISO 14443A up to Level-4
N.B2: when I use the constructor demokit I can read the EEPROM values when the NFC is supplied via the SPI interface.
I contacted the manufacturer "ams". They said that this tag (AS3953 HW) is not NFC Forum standards compliant (contrary to what is mentioned in the datasheet). So to read passively the tag I have to code their proprietary commands (a list is provided in the datasheet) into my app.

Read RFID tag that is already next to the phone before my app started

I wrote a small program that is scaning for RFID Tag, it works fine. But I have a case that I need to read an RFID tag that is already next to my phone before my app started.
Is there a way that can tell Android to scan again for a nearby RFID/NFC tag?
Thanks
No, The Tag is 'Discovered' when it moves into range of the device NFC aerial. You could however utilise the 'Background Dispatch' facility, whereby you define your filters for NFC intents in your Activity definition in your Manifest, as described in the Android documentation for NFC Basics. This way, when you place the Tag near to your device it will read the Tag and start your application at the defined Activity.

Categories

Resources