title: Setting up host card emulation
body: <p>I am currently attempting to connect between an Arduino UNO with NFC Shield to my Nexus 4 running Android 4.4.</p>
  
  <p>I have the service setup, it's simply logging at the moment. Problem is, the NFC intent doesn't get bound to my app. The debugger reports the following error:</p>
  
  <pre><code>11-24 02:45:46.139    4006-4027/? E/BrcmNfcNfa﹕ UICC[0x0] is not activated
  </code></pre>
  
  <p>So here's my 2 questions:</p>
  
  <ul>
  <li><p>On the Arduino side of things, what kind of 'message' does the NFC shield needs to send to my phone for my phone to understand that I'm looking for a certain app in category 'Other'?</p></li>
  <li><p>On the android side of things, what will be the aid-filter tag value to catch that intent? Can I make up a custom one or do I need to stick to some kind of ISO specification for this to work?</p></li>
  </ul>
  
  <p><strong>UPDATE</strong></p>
  
  <p>OK so here's the relevant part of my Arduino sketch where I build my APDU:</p>
  
  <pre><code>            uint8_t message[5];
  
              message[0] = 0x00;
              message[1] = 0xA4;
              message[2] = 0x04;
              message[3] = 0x00;
              message[4] = 0x08;              
              message[5] = 0x4C656C616E746F73ULL;
  </code></pre>
  
  <p>And here's the APDU service XML file in my android app:</p>
  
  <pre><code>&lt;host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
      android:description="@string/servicedesc"
      android:requireDeviceUnlock="false"&gt;
      &lt;aid-group android:description="@string/aiddescription"
          android:category="other"&gt;
          &lt;aid-filter android:name="4C656C616E746F73"/&gt;
      &lt;/aid-group&gt;
  &lt;/host-apdu-service&gt;
  </code></pre>
  
  <p>And this is the log I get when I hover my phone over the NFC shield:</p>
  
  <pre><code>11-24 22:33:40.563    4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: event=0x18
  11-24 22:33:40.563    4006-4027/? D/HostEmulationManager﹕ notifyHostEmulationActivated
  11-24 22:33:40.563    4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: event=0x17
  11-24 22:33:40.563    4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: NFA_CE_DATA_EVT; h=0x302; data len=5
  11-24 22:33:40.563    4006-4027/? D/HostEmulationManager﹕ notifyHostEmulationData
  11-24 22:33:40.563    4006-4027/? D/HostEmulationManager﹕ Dropping non-select APDU in STATE_W4_SELECT
  11-24 22:33:40.683    4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: event=0x17
  11-24 22:33:40.683    4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: NFA_CE_DATA_EVT; h=0x302; data len=5
  11-24 22:33:40.683    4006-4027/? D/HostEmulationManager﹕ notifyHostEmulationData
  11-24 22:33:40.683    4006-4027/? D/HostEmulationManager﹕ Dropping non-select APDU in STATE_W4_SELECT
  11-24 22:33:40.804    4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: event=0x17
  11-24 22:33:40.804    4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: NFA_CE_DATA_EVT; h=0x302; data len=5
  11-24 22:33:40.804    4006-4027/? D/HostEmulationManager﹕ notifyHostEmulationData
  11-24 22:33:40.804    4006-4027/? D/HostEmulationManager﹕ Dropping non-select APDU in STATE_W4_SELECT
  11-24 22:33:40.924    4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: event=0x17
  11-24 22:33:40.924    4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: NFA_CE_DATA_EVT; h=0x302; data len=5
  11-24 22:33:40.934    4006-4027/? D/HostEmulationManager﹕ notifyHostEmulationData
  11-24 22:33:40.934    4006-4027/? D/HostEmulationManager﹕ Dropping non-select APDU in STATE_W4_SELECT
  11-24 22:33:41.054    4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: event=0x17
  11-24 22:33:41.054    4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: NFA_CE_DATA_EVT; h=0x302; data len=5
  11-24 22:33:41.054    4006-4027/? D/HostEmulationManager﹕ notifyHostEmulationData
  11-24 22:33:41.054    4006-4027/? D/HostEmulationManager﹕ Dropping non-select APDU in STATE_W4_SELECT
  11-24 22:33:41.174    4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: event=0x17
  11-24 22:33:41.174    4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: NFA_CE_DATA_EVT; h=0x302; data len=5
  11-24 22:33:41.174    4006-4027/? D/HostEmulationManager﹕ notifyHostEmulationData
  11-24 22:33:41.174    4006-4027/? D/HostEmulationManager﹕ Dropping non-select APDU in STATE_W4_SELECT
  11-24 22:33:41.304    4006-4027/? D/BrcmNfcJni﹕ RoutingManager::stackCallback: event=0x19
  11-24 22:33:41.304    4006-4027/? D/HostEmulationManager﹕ notifyHostEmulationDeactivated
  11-24 22:33:41.304    4006-4027/? E/BrcmNfcNfa﹕ UICC[0x0] is not activated
  </code></pre>
  
  <p>How come Android isn't routing the APDU to my HCE Service?</p>