Toward a native NFC app

If and when I implement support for Card Emulation mode (I haven’t lost interest in it, there’s a chance that it gets finished later this year) then it should be possible by emulating a Type 4 tag with an NDEF containing whatever you want to share.

10 Likes

That sounds promising enough. I’m not a developer but if there is anything else I can do to ease your pain, I’ll be glad to. :slightly_smiling_face:

1 Like

Stuff like that need to be baked in the OS itself. In the share options.

Those two are not synonyms (fortunately). But i presume you know that?

If you mean the adding stuff to the share options (like the way you share to the printer) yes. Its just that i believe that there should be a “limit” (cant think of a better word at the moment) to what should be a separate app and something that should be OS functionality.

Its not that the whole “there is an app for that” doesn’t get things done but i like less clutter.

Anyway. I was just thinking out loud.

3 Likes

Well, as slava points out, a lot depends on what is implemented on the ‘smart card’ these days. The case that got me thinking about this is, in a sense, not such a smart card. However, interacting with it is never just a case of doing some generic ‘NFC’ thing. It requires talking to a third party (the gov’t) via an intermediary to even get to write to the card. I’m trying to find the route with the most minimal amount of app that’s required to be able to use the card. And there is no way that could be anticipated by the OS. Same goes for my Mastercard, for that matter :slight_smile:

Storage of NDEF records on a Type 4 tag is standardized, it’s a viable sharing option. It’s only suitable for small amounts of data, though - a few kilobytes or so. Another option would be “connection handover” (when the actual data get transferred over Bluetooth or WiFi) which is how it was implemented in Nokia N9 but I doubt that any other phone in the world supports it these days.

2 Likes

Just to be clear i didn’t mean to bake in the OS every NFC smart card functionality. Or writing tags. Apps for that are fine. But sharing a contact with NFC makes sense to be in the OS. To me at least.

1 Like

Share a contact with which other operating systems? I don’t believe you’ll get far with Apple devices. Until the EU forces them to interoperate. I’m not sure about Android? I always did Bluetooth in those years that I used Android. Does NFC sharing generally work in Android?

1 Like

Isn’t it that with this kind of sharing, NFC just sets up the BT pairing, and the rest is then handled by the BT layer (obex and things)?

2 Likes

TBH support for NFC is being deprecated in Android - specifically NFC-DEP (aka Android Beam) has been removed from their git repos, meaning that connection handover the way it was implemented by Nokia N9 (exchange of NDEF records containing BT addresses over NFC and then transferring the actual files over BT) is no longer possible with modern Android phones. I have no idea why NFC-DEP is getting removed from Android but it has already happened and there’s no way back :neutral_face:

On the bright side, Sailfish OS is becoming more functional than Android in terms of NFC functionality :slightly_smiling_face:

8 Likes

Well any data flow that does not go through Google’s servers is of course suspicious and must be purged from the Google OS.

5 Likes

So that means that Android Beam is gone, but does that mean NFC generally? Can’t imagine that? Sounds strange. But, then, google is an advertising company. The amount of cocaine abuse in ad companies is legendary. Looks like the ‘next’ iteration is the closed source ‘Nearby share’ thingy?

No, it’s just P2P mode that is gone, NFC Reader/Writer mode is fully supported (and is likely to stay), support for Card Emulation (both host and SE-based) is still there too, AFAICT. And at least SE(secure element)-based Card Emulation definitely isn’t going anywhere because it’s required for contactless payments.

2 Likes

NDEFined

1 Like

BTW NFC sharing has been integrated into SFOS not so long ago.

7 Likes

Is this something that would only work on the OS level or can I emulate a tag over dbus (the same way I can write to a tag) without going through a share plugin?

ndef-share is the example of a standalone app which does more or less the same thing as the NFC share plugin. You don’t have to go through the sharing system in order to emulate a Type 4 tag, it can be built into the app.

Note that Card Emulation is a fairly recent addition. The basic CE API first appeared in nfcd version 1.2.0 (which made it to SFOS 5.0), support for configuring NFCID1 in 1.2.2, configuring HB (Historical Bytes in Listen A mode) in 1.2.4.

The nfcd version can be queried at run time over D-Bus. For example my Fillari app only enables the “pick up the bike with NFC” function (requires setting up NFCID1) when it’s running against nfcd version 1.2.2 or newer. I have manually compiled and installed the required rpms on my daily phone to make it work - other people don’t see that menu item (if there are any other people using this app)

6 Likes