Daniel's NFC Development Weblog

I like to provide developer insight on things that especially concern this new upcoming contactless technology called Near Field Communication (NFC).

Friday, April 20, 2007

After WIMA 2007

Although I wasn't with the finalists of the European NFC Competition, I decided to head over to Monaco anyway to attend the WIMA 2007 convention.

WIMA is a convention for various wireless mobile applications, but the majority of it was targeted at the NFC Developers' Summit - for me, at least.

It was a delight to learn about all the players in the European NFC scene today. I've attended many presentations about various projects such as HCI, iO TouchPro and Celcius.

I've also had the pleasure to shake hands with several people I've had contact with, but have never seen before. We've exchanged business cards and we're looking forward to seeing each other next year at the 2008 European NFC Competition.

About the location, here's some pictures of the Grimaldi Forum, Monaco:

Monday, February 12, 2007

NFC Forum released Marketing White Paper


Today, the NFC Forum has released their white paper on "Near Field Communication and the NFC Forum: The Keys to Truly Interoperable Communications".

Frankly, I had found this document some time ago, and what was astounding to me was the great number of Cellular Handsets ABI research predicts to be in 2011. 2,000,000,000 (two billion) handsets of which 500,000,000 will be equipped with NFC! (See page 4)

That means you, my dear developer, have got a nice big upcoming not-niche market to develop things for. So go out and make these things! And leave me a message when you're finished.

Source

NFC Magazine
http://www.nfcmagazine.com/content/view/88/2/

Download

http://www.nfc-forum.org/resources/white_papers/nfc_forum_marketing_white_paper.pdf

Thursday, February 8, 2007

Daniel's NFC Development Weblog

I've moved the official site name from Daniel's Weblog to Daniel's NFC Development Weblog, since that really is what it's all about.

The new domain name for this site is: http://www.nfc-development.org/.
The old http://danielsweblog.blogspot.com/ will still be active for backward link compatibility.

Please update your Bookmarks/Favorites, and update your feed reader!

Tuesday, January 30, 2007

JSR 257 RI SDK FAQ

This article, with an ALLCAPS title, answers Frequently Asked Questions about the the Contactless Communication API (Java Specification Request no. 257) Reference Implementation Software Development Kit.

Nokia JSR 257 RI SDK Emulator Learn about what it is, what you can and can't do with it, and how to work with it.

What is the JSR 257 RI SDK?

A software development kit released by Nokia, only eight days after the Final Release of the Contactless Communication API, that enables software developers to write their own NFC applications in Java, without the need for an extra, proprietary SDK from Nokia.

When more NFC phones, built according to these specifications, will be produced, your NFC MIDlets will also run on these phones.

The SDK comes with a big bunch of documentation. Some very intriguing features such as Bluetooth configuration and NFC Peer communication are listed in the docs, but appear to be missing from the implementation.
I figure that Nokia already has the actual implementation for these things, but that they are still in beta testing phase, or awaiting the NFC Forum's official release.

What can I do with it?

You can write NFC MIDlets that will run on both the physical 6131 NFC phone (as soon as you get your hands on that) and on the emulator supplied with the SDK.
You can do everything that's written in the NFC Forum specs about NFC tags. You can write Plain text records, URI records, and Smart Poster records to them in order to make your environment fully touchable.

What can I not do with it?

You can't, yet, develop applications for communication between two NFC peers.
Which makes sense, since the specs haven't yet been released by the NFC Forum.

How do I work with it?

If you have developed applications with a Nokia SDK before, you'll probably have all the required software installed. If you're new to development on Nokia platforms, please take a look at the Installation Instructions document that comes with the package.

The SDK comes with precompiled sample applications that can be run in an emulator. If you want to run them on your 6131 NFC, you'll have to recompile them for physical use.

You can ofcourse edit the sample applications' text files manually and then invoke ant at build time, but I'd suggest you first import the projects into NetBeans before you start developing, which will save you a lot of time.

Importing and debugging Nokia's NFC sample applications with NetBeans 5.5

NetBeans is an Open Source Java IDE that comes with many nifty features. It does not only feature code completion and a debug mode, but also allows you to design MIDlets instead of coding the screens by hand. Importing Nokia's sample applications into NetBeans saves time, prevents typos, and increases developer convenience.

In short

  • This article covers how to import one of Nokia's sample applications, Contactless, into NetBeans IDE 5.5.

  • Using NetBeans IDE saves time with features such as code completion, syntax checking and debugging.

About Nokia's Contactless sample application

Contactless is part of Nokia's JSR 257 RI SDK, the first SDK that allows Java developers to write their very own NFC MIDlets. For now, the Nokia 6131 NFC is the only phone to support JSR 257. The JSR 257 API, currently, can only be used to operate on NFC tags, and not yet on NFC peers.

NetBeans bundled with Mobility Pack

The mobility utilities don't come standard with NetBeans 5.5, but with a special add-on called Mobility Pack. I'll assume you've downloaded and installed first a Java JDK, and then both NetBeans and Mobility Pack.

Why use NetBeans?

First off, since I've been using it for a few years now, and I find it a very adequate IDE. The JSR 257 RI SDK comes with only a buildfile and some sources, so editing the sources had to be done using a text editor.

Text editors don't know much about code and/or code completion, so many times I have to bounce back and forth between my editor and the API documentation to get the correct names.

And how about context compiling? If you type something into NetBeans, it will do a quick 'background check' on whether your syntax is correct, and if you've imported what you are using on the spot.
If not, you'll get a red line under the line where NetBeans thinks you've erred.

And another thing I frankly haven't yet used with this SDK: The MIDP designer mode. Using NetBeans + Mobility pack, you can create your MIDlet's screens in a visual design mode.

Using NetBeans will save me time not having to switch between editor and API documentation, will prevent me from getting compiler syntax errors, and has many more features that make my life easier. I can even debug my applications with it!

Adding the JSR 257 RI SDK emulator

Here, we'll cover how to use the emulator shipped with Nokia's JSR 257 RI SDK into NetBeans 5.5. These instructions are not specifically for the RI SDK, but can be used with any emulator package that conforms to the standard specifications. This means that you can import virtually any J2ME emulator into NetBeans using these instructions.

Select Tools -> Java Platform Manager.

NetBeans 5.5 Java Platform Manager dialog

Click Add Platform, and select Java Micro Edition Platform Emulator.

NetBeans 5.5 Add Java Platform dialog

Frankly, the platforms listed showed up automagically! Appearantly, NetBeans had already found them in my c:\Nokia\Devices directory.



As you can see, I have some more emulators in my Devices directory. We'll only need the JSR 257 emulator. Click Next, and you'll get a page about the Platform Details. If all looks OK to you, and you agree with the Platform Name, click Finish.

Importing the project

In this example, we'll import the project called Contactless into our NetBeans IDE.

Select File -> New Project -> Mobile -> Import Wireless Toolkit Project.

NetBeans New Project dialog
Click Next, and in the next screen, specify a different WTK location.

NetBeans Specify WTK Project dialog
Here, you must locate your Nokia JSR 257 RI SDK's sample applications.
On my computer, they're located at C:\Nokia\Devices\JSR_257_RI_1_0\samples\contactless.

NetBeans 5.5 Name and Location dialog
We'll keep the name ImportedProject-Contactless.
Please note that NetBeans will not copy the source files from the Contactless project into your new project folder. When you change your source files, the original files will be affected, so that you can keep compiling your project in Wireless Toolkit, if you prefer to.

Next is Default Platform Selection. Don't use J2ME Wireless Toolkit 2.2 here, but use the platform we've just added.

NetBeans 5.5 Default Platform Selection dialog
Now click Finish. Congratulations! You have now successfully imported the Contactless project into NetBeans.

The project should look like this:

NetBeans 5.5 ImportedProject-Contactless
Because the emulator conforms to the standard conventions, you now have the Debug option for free! Just select Run -> Debug (F5) to start debugging in the supplied emulator.

The emulator doesn't look as if it's the prettiest S40 emulator around, but it works OK:

Nokia NFC emulator
When the MIDlet enables its NFC functions, the emulator will show the Contactless Simulator dialog that you can use to place various tags inside and out of the RF field.

Nokia NFC Contactless Simulator
Conclusion

This concludes on how to import a Nokia sample project into NetBeans. Using NetBeans instead of plain command-line Ant and a text editor might be an investment, but saves time in the future, and contributes greatly to developer productivity.

Thursday, January 25, 2007

Nokia 6131 NFC showed off at CES

Nokia showed off their 6131 NFC at the CES, January 8 - 11, Las Vegas. What's featured:

  • Smart Poster: The Hotel and Elvis posters house RFID tags that contain NDEF records with phone number information. By touching the tag, the user is prompted with a request to dial the number stored on the tag.
  • Business card exchange: Jason Fitzgerald's Exhibitor pass contains an RFID tag with his business card on it. By touching the tag, the user can give permission to store the business card in the phone's memory.
  • Smart Photograph: Basically the same as the Smart Poster concept, but this time the RFID tag is contained in a photo frame.
  • NFC Printing: Touching the printer causes the photo printer to establish a Bluetooth connection with the phone. (This is called pairing) The phone then sends the user's desired picture over to the printer.
  • Smart Photo Frame: An interactive, Bluetooth-enabled photo frame can be touched with the 6131 NFC in order to change the picture it currently holds. After touch, the user selects his desired picture which is then transferred over to the photo frame. The frame then immediately displays the picture.
  • Visa/Master Card payment: Transactions can be made by touching an NFC reader with the Nokia. Optionally, a passcode can be set for transactions that exceed a specified amount, so that the user has to enter their passcode before a transaction can be made.

Tuesday, January 23, 2007

Nokia releases new 6131 NFC phone

January 8, 2007: Nokia has brought out the details about their latest technology packed in an already familiar clamshell phone. The Nokia 6131 NFC is the first phone to enable Java developers to write MIDlets that can access functions according to the NFC Forum's specifications.

From the article:


"With Nokia 6131 NFC phone you can have your credit card, travel card and loyalty card in your phone and use it as a multi-purpose smart card. Use the Nokia 6131 NFC to pay for your purchases with speed and ease or access any mobile services, e.g. weather forecast and the latest news just by touching a tag."

NFC-aware MIDlets

In conjunction with the JSR 257 Reference Implementation, a developer is able to write NFC-aware MIDlets that need only be written once for the Java platform. With the Nokia 3220, developing NFC MIDlets had to be facilitated by the Nokia SDK for Payment and Ticketing. Hence, these MIDlets were only usable on a Nokia 3220 that had the special NFC Shell for Payment and Ticketing on them.

In theory, a MIDlet can be written that will communicate flawlessly with future NFC devices - even if these come from different brands or manufacturers. Because the JSR 257 implementation on this phone adheres to the official NFC Forum specifications, any device that has a similar implementation will be compatible with this phone, and vice versa.

Features

The Nokia 6131 NFC has some nifty features that will make the developer's life much easier. Whereas the Nokia 3220 had to be fed MIDlets using either a slow serial data cable, or an even slower GPRS connection, the 6131 NFC has Bluetooth available which allows MIDlets to be translated to the phone without any wires in-between.

The maximum JAR size is 1MB, which means that developers will have more room for shiny images and the like. This is a major improvement on the Nokia 3220's JAR size limit of a mere 128KiB. But you might even eliminate the need to add large PNG images to your JAR file completely, because the 6131 NFC also supports JSR-226, the Scalable 2D Vector Graphics API.

SVG format

This means that you can add images to your MIDlet in the SVG format. These images do not consist of mere pixels, but of vectors that will be automatically scaled to fit your screen. Hence, you won't have to worry about the screen size of the intended device. Which is a good thing, since some VGA phones with a whopping 640x480 resolution can already do MIDlets!

Web services

And if you're planning to do some serious service interaction with the 6131 NFC, you have the Web Services API (JSR-172) at your disposal. This means that you can simply use an existing Web Services Definition File (WSDL) to automatically generate a stub MIDlet! All you have to do is add images, change strings, customize things to your liking. The functional part as a whole has been dynamically generated from the WSDL file you supplied to the wscompile tool.

Your WSDL file has to be WS-I compliant, though. This means that it does not include some of the more complex types such as DateTime and the like.

Availability

The Nokia 6131 NFC is expected to be shipped in the first quarter of 2007.

Source: