6

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?

Carlo
  • 1,539
  • 1
  • 11
  • 25

2 Answers2

1

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

Community
  • 1
  • 1
Sterling
  • 6,365
  • 2
  • 32
  • 40
  • I think the same. My only hope is that CanvasWatchFaceService is some kind of "special" service due to the fact that it has an user interface that is not common for Android services. So maybe it can also handle NFC in some way – Carlo Jun 27 '16 at 14:08
0

Besides the fact that NFC discovery intents (for reading NFC tags) are activity intents and, consequently, do not trigger services or broadcast receivers, there currently is no Android Wear device with real NFC support. Even the NFC support in the Sony Smartwatch 3 is limited to the watch emulating a static Type 2 tag (though the hardware itself would be capable of performing the full NFC functionality, see Is there an NFC API for the Smartwatch 3 (SWR50)).

Community
  • 1
  • 1
Michael Roland
  • 39,663
  • 10
  • 99
  • 206
  • 1
    Standard Sony Smartwatch 3 doesn't give access to NFC, that's why I had to modify it as explained here: http://forum.xda-developers.com/smartwatch-3/orig-development/sony-smartwatch-3-nfc-support-package-t3219713. My question is if in this scenario there's a way to handle NFC from a CanvasWatchFaceService class (that has an output on video but I'm not sure if can handle intents) – Carlo Jun 29 '16 at 06:58