Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access NFC tag from a clock app in Android wear

I developed a wearable app for Android Wear that read NFC tags. The hardware I used is a Sony Smartwatch 3 modified following instructions on this link: Sony SmartWatch 3 NFC Support Package.

Now my objective is to make a clock app able reading NFC.

Problem is: Android Wear apps are not based on activities but on services, despite the fact that they interact with user and have an output on screen.

Android NFC library has many limitations, one of them (as far as I know) is that it can be used only inside activities.

So my question: is there a way to use Android NFC library (android.nfc.tech.NfcV) and manage NFC tags inside a CanvasWatchFaceService class?

like image 417
Carlo Avatar asked Jun 25 '16 05:06

Carlo


People also ask

Can Android emulate NFC tag?

Many Android-powered devices that offer NFC functionality already support NFC card emulation. In most cases, the card is emulated by a separate chip in the device, called a secure element.

How do I scan a NFC tag?

IOS & Android devices can scan an NFC tag by tapping the physical tag to instantly pull up information on the device. The Scan app stores all information read on any tag (even non Array tags).


1 Answers

According to Stack user Michael Roland (who appears to be a solid NFC expert), reading NFC data isn't possible from a Service in Android. Reference: https://stackoverflow.com/a/19637784/252080

like image 57
Sterling Avatar answered Oct 19 '22 00:10

Sterling