title: Make Read Only access for Mifare UltraLight using Android
body: <p>I can write my data on card successfully. I want that no one can write on my card, but that they can only read. Is this possible to achieve? Or is there any key where I can assign some password protection before writing data on my card?</p>
  
  <p>To write data using:</p>
  
  <pre><code>public void writeTag(Tag tag) {
          MifareUltralight ultralight = MifareUltralight.get(tag);
          String[] mg= getParts(s, 4);
  
          try {
              ultralight.connect();
              int j=4;
              for (int i = 0; i &lt; mg.length; i++) {
  
                  ultralight.writePage(j, mg[i].getBytes(Charset.forName("US-ASCII")));
                  j++;
              }
              Toast.makeText(getApplicationContext(), "Write Done!", Toast.LENGTH_LONG).show()
          } catch (IOException e) {
              Log.e(TAG, "IOException while closing MifareUltralight...", e);
          } finally {
              try {
                  ultralight.close();
              } catch (IOException e) {
                  Log.e(TAG, "IOException while closing MifareUltralight...", e);
              }
          }
      }
  </code></pre>
  
  <p>Any help would be appreciated!</p>