My friend Chris Bernardi invited me to join his team for the Isobar Create 48 NFC Hackathon along with April DiMartino and Marc Neuwirth. The event kicked off on Tuesday around 3 PM at Space with a Soul. Before the hackathon there were some general Near Field Communication (NFC) presentations by Isobar, Nokia and ICS. After the NFC intro, they kicked out the people who came for the presentations so we could get started.
None of us came to the hackathon with the killer application idea. We brainstormed for a while, discarding lots of half-baked ideas and ended up deciding to build an NFC solution to make parking better. We came up with a bunch of scenarios, but decided to limit our initial implementation to garages with entrance and exit gates, so it was easier to track inventory.
April does an excellent job describing our application:
The working title of the app is “I Got Your Ticket Right Here” and is best understood when said with a Brooklyn NY accent ;-) We haven’t worked out a shorter and more appropriate title for it yet. So for purposes of this I will simply refer to it as the Parking app.
The way we like to describe the problem that the Parking app is trying to solve is: Parking Sucks
We wanted to figure out how we could make it suck a little less by addressing some of the most common problems that people have when parking in the city like:
- Where can I park?
- Is there space in the garage?
- What does it cost?
- Does it fit my needs (I need overnight parking; I need oversized vehicle parking; valet service, does the garage accept credit cards, etc)
- What do I do with the ticket I get on the way in? Is this a garage where I need to take the ticket with me, or leave it the car?
- How can I validate my parking?
- How do I keep track of where my car is?
- When is the garage closing?
- How do I pay for the parking? Do I need to find a kiosk or drive to the exit and interact with a machine or maybe a person?
Our Parking app attempts to solve all of these problems using your NFC enabled mobile device. The Parking app will locate garages near you and provide details about the garage, allow you to filter for the parking garage features that you are most interested in, and give you directions to the garage. The app will also tell you how many available spaces there are for each garage, so you know what to expect when you arrive. Upon arriving at the garage you simply tap your phone to the NFC code at the garage entrance gate and you are checked in to the garage. If you have trouble remembering where you parked your car, when you arrive at your parking spot you can tap the NFC code at the spot to save your location. Later on when you are wondering where you car is, the app can tell you where your car is parked and provide directions back to the garage. The app can also provide reminders for when a garage is closing or a time period is about to expire. You can tap an NFC code at participating local businesses that provide parking discounts or validated parking which the app will deduct upon your check out from the garage. When you leave the garage simply tap your phone to the NFC code at the exit gate and the app will present you with a choice of payment profiles (business or personal, or perhaps multiple credit cards or other payment options), select a payment profile and you are checked out. A receipt is emailed if desired and never once did you see a piece of paper!
We created 3 pieces of software for this solution. The server, a mobile application and software for the gates.
The server is written in Lithium and MongoDB. We provide a REST based API for the phones and gates at the garage. The server manages users, inventory, garage entrance, garage exit, processes payments and mails receipts. We take advantage of Mongo’s Geospatial Indexing for finding the closest garages.
The UI was written in JQuery Mobile. Chris customized the code so it didn’t look like stock jQuery. Dave Riley helped us out by suppling color palate. Marc worked magic integrating Google Maps, disabling the misbehaving transitions, and supplying other jQuery tips and tricks.
We wrote software to represent the entrance and exit gates at the garage. The gate software uses NFC peer-to-peer messaging. The gate publishes an NFC message, reads for incoming messages, and communicates with the parking server.
With NFC, the physical action of scanning a tag results in a virtual reaction in software. Scanning the entrance gate at a garage opens the Android application and checks the user into the garage. (The server also sends a message to the gate telling it to open.)
NFC vs QR
Scanning NFC tags is easy for the user. It only requires the phone to be on and unlocked. Scan a tag and the software reacts. Contrast this with scanning a QR code. QR codes requires more work. Turn the phone to be on, find scanning software, open application, focus camera, choose action. None of it’s difficult, there are just more steps.
Tag ID vs Mime Type
In order to associate NFC tags with our application, we need to write data on the tags. We use an NDEF Message and set the message type to TNF_MIME_MEDIA. For the parking application, this allows use to associate the mime type of text/park with our application. In the Android application manifest we define an intent filter that will open our application any time the phone discovers a NDEF tag with our mime type.
<application ...> <activity ...> <intent-filter> <action android:name="android.nfc.action.NDEF_DISCOVERED" /> <data android:mimeType="text/park"/> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> </application>
The intent filter in our application allows our user to: enter the garage, scan a parking spot, validates parking, and exit the garage all without opening the application. Simply scan a tag (or reader) and it works. This is great stuff.
What about all those other phones?
We could even issue NFC parking cards, like the Charlie Card for people without a smart phone.
There were many hours hacking, working, ups and downs, lack of sleep, arriving at 2AM and finding the car locked in the parking garage (inspiring the user notification idea “The garage closes in 20 minutes and you haven’t got your car yet.”) Somehow in the end we pulled everything together with a last minute Android build at 2:59 PM to fix a typo.
April was our spokesperson and did an amazing job explaining the problem and our solution, and presenting the demo. Fortunately everything worked in the demo and the judges seemed to like it. After all the presentations, we got a chance to go home, eat, and change before returning again that evening. At the awards after party we learned we won 2nd place! I’m really proud of what our team accomplished in less that 48 hours.