I'd like to send and trigger opening of an HTML page via NFC/Android Beam in the way that's compatible with stock Android devices (and ideally any NFC-compliant smartphone).
I'd like this to work off-line, so I'm trying to send actual HTML payload rather than an HTTP URL.
I've tried sending data:text/html,…
URL, but unfortunately Android doesn't open these URLs in a browser. It shows it in "New tag collected" app without ability to take any action.
I've tried sending text/html
MIME payload, but again it shows as unclickable "text/html" entry in "New tag collected" app.
I'm using this example with this modification:
@Override public NdefMessage createNdefMessage(NfcEvent event) { return new NdefMessage( NdefRecord.createMime("text/html", "Hello".getBytes()), NdefRecord.createUri("data:text/html,Hello") ); }
How can I send text/html file that Android will automatically open in a browser?