title: Accessing card-emulation mode on USB-NFC-Reader
body: <p>I have an Android tablet with Android 4.2. This tablet does not have NFC hardware. However I have an external USB reader: <a href="http://www.acs.com.hk/en/products/342/acr1252u-usb-nfc-reader-iii-nfc-forum-certified-reader/" rel="nofollow noreferrer">ACR 1252U</a>, that came with an <a href="http://android.acs.com.hk/" rel="nofollow noreferrer">Android library</a>. I have asked some general questions of my setup <a href="https://stackoverflow.com/questions/33496019/android-nfc-with-usb-nfc-reader">here</a>. Now that it gets more specific, I need to ask another one. In this previous question I found out, that I can use the <em>ACS Android library</em> to access the readers <strong>card emulation</strong> capabilities. </p>
  
  <p>My first goal is to make that reader emulate an NFC tag, that contains a URL. Any NFC-capable Android phone should be able to scan this emulated tag and automatically open the browser. I have tested it, and it works with a real (physical) tag. But unfortunately I am not able to emulate this tag correctly...</p>
  
  <p>Now I wrote an Android application, but I am stuck. According to the <a href="http://www.acs.com.hk/download-manual/6402/API-ACR1252U-1.08.pdf" rel="nofollow noreferrer">readers API (PDF)</a>, I can get it into card emulation mode by sending the command</p>
  
  <pre><code>E0 00 00 40 03 01 00 00
  </code></pre>
  
  <p>When I do this, it gives me the answer:</p>
  
  <pre><code>E1 00 00 00 03 01 01 01
  </code></pre>
  
  <p>This confirms, that it is in card emulation mode. With an Android application I now can scan the emulated Tag, which says, that this is recognized as a "NXP MIFARE Ultralight" tag.</p>
  
  <p>My problem now is, how to feed the tag with a URL. According to the reader API (section 5.10.3), I need to send the command:</p>
  
  <pre><code>E0 00 00 60 13 01 01 00 0F D1 01 0B 55 01 67 6F 6F 67 6C 65 2E 63 6F 6D
  </code></pre>
  
  <p>where <code>D1 01 0B 55 01 67 6F 6F 67 6C 65 2E 63 6F 6D</code> is the NDEF message that contains the URL "<a href="http://www.google.com" rel="nofollow noreferrer">http://www.google.com</a>". I created this NDEF message using this Android Java code:</p>
  
  <pre><code>String target_url = "http://www.google.com";
  Uri uri = Uri.parse(target_url);
  NdefRecord recordNFC = NdefRecord.createUri(uri);
  NdefMessage message = new NdefMessage(recordNFC);
  </code></pre>
  
  <p>An application on my Android phone, that reads NFC tag says the following:</p>
  
  <p><a href="https://i.stack.imgur.com/1cNWK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1cNWK.png" width="200"></a></p>
  
  <p>As you can see, the URL is saved on the emulated tag.</p>
  
  <ul>
  <li>So why doesn't the browser of my phone open the url? </li>
  <li>Am I missing something? Are my commands wrong?</li>
  <li>Why are there some "?" characters?</li>
  </ul>