Categories
Android App Development NFC

NFC Tags, NDEF and Android (with Kotlin)

In this article, you will learn how to add NFC tag reading to an Android app. It registers for auto-starting when the user taps a specific NDEF NFC tag with the phone. In addition, the app reads the NDEF records from the tag.

NFC & NDEF

Apple added support for reading NFC tags with iOS 11 in September 2017. All iPhones starting with the iPhone 7 offer an API to read NFC tags. While Android included NFC support for many years, this was the final missing piece to bring NFC tag scenarios to the masses.

Categories
App Development NFC Windows

Porting the NFC / NDEF Library to .NET Standard

With around 20,000 downloads, the “NFC / NDEF Library for Proximity APIs” is the most popular NFC library for C#. The library has initially been released in 2012 and has since been extended to cover many standardized as well as common NDEF use cases – also thanks to the support of the netidee open innovation platform.

Lately, the underlying platforms have evolved, and now the library has adapted. The main NFC library has now been ported to .NET Standard, which is a common baseline that makes the library compatible to even more different platforms. The new version 4.1.0 is now available under the open source LGPL license on GitHub, as well as on NuGet.

In addition to running on Windows, the library now fully supports all platforms that support .NET Core (like Linux and Mac), as well as Xamarin for Android and iOS. This makes it significantly easier to provide NFC functionality across different platforms – especially now that the iPhone also finally supports the open NDEF standard within NFC through the Apple Core NFC framework.

Categories
App Development NFC Windows

.NET Standard Libraries and NuGet Package Wizard

A few days ago, Microsoft has released  .NET Standard 2.0, which is the new dreams-come-true platform for libraries. Additionally, Portable Class Libraries (PCL) have since also been deprecated. Therefore, it’s about time to port my existing libraries.

In addition, also Visual Studio 2017 Version 15.3 with full support for .NET Standard 2.0 was released, as well as the latest Windows 10 Fall Creators Update Preview SDK. So, let’s get started!

.NET Standard vs. UWP

However, it turns out that UWP doesn’t yet support .NET Standard 2.0. For the UWP platform, the latest supported .NET Standard version is still 1.4, which is considerably less powerful.

Attempting to reference a .NET Standard 2.0 library from an UWP app leads to errors, including the following that gives it away:

Project '...' targets '.NETStandard,Version=v2.0'. It cannot be referenced by a project that targets 'UAP,Version=v10.0.10240'.

Upgrading the UWP project to the latest SDK Preview for the Windows 10 Fall Creators Update Build 16257 doesn’t change anything; both the SDK and the new Visual Studio 2017 version 15.3 can not yet use .NET Standard 2.0 in conjunction with UWP. According to Microsoft, that will be coming soon with the next UWP version.