Reputation: 1829
I am working on an application that reads an NFC tag and takes the ID to out into a search query for a web app.
At the moment the only way to do this is include the entire URL on the tag i.e. example.com/search?=tagid
when scanning the tag with say an droid device it simply opens the browser to that url.
Is there anyway I can write just the tagid to the NFC tag, and have to ID say auto populate a form field within the browser?
I have looked around but cannot seem to find anything. So thought I would ask here.
The web app is being written in PHP and javascript.
Thanks
Upvotes: 1
Views: 5359
Reputation: 31
I spent a whole day dealing with this issue, so I feel the need to share my solution.
I use two apps. NFC tools to program the NFC tag, and Tasker to do the input. NFC tools can program a tag to call a Tasker task. And in Tasker I have a task to write data to whatever field is currently active. Should be browser and language independent.
Also, in my case, I use the clipboard as a buffer so I don't need to program a bunch of Tasker tasks. You program the data once into the tag, drop it into the clipboard, and then Tasker just does the paste for you.
Upvotes: 3
Reputation: 878
The phone OS decides what to do with the data on the NFC tag, depending of the type of data. If the phone finds a URL, it opens the browser with that URL (unless a local app on the phone has registered for that URL).
If you like to store only the ID, maybe because the URL is very long, then you can create a dedicated app for the phone, that creates the URL on the fly once it receives the ID, and then launches the browser.
If the space for the URL is to small for your URL, you may consider a URL shortcut, such as tinurl (tinyurl.com).
Upvotes: 1