title: android nfc - mifare classic 1k Increment operation tranceive failed
body: <p>I want to store an integer value and increment or decrement it with API function.</p>
  
  <p>I have readed the card with an utility and this is the content of block 5:
  <img src="https://i.stack.imgur.com/mElAR.png" alt="enter image description here"></p>
  
  <p>It seems that there is not any value block. </p>
  
  <p>This is my code:</p>
  
  <pre><code>    int sector = 5;
      this.mClassic.connect();
      boolean success = this.mClassic.authenticateSectorWithKeyA(sector, MifareClassic.KEY_DEFAULT );
  
          if(success){
              int firstBlock = mClassic.sectorToBlock(sector);
              Log.i("MIFARE CLASSIC", "first block of the given sector:" + firstBlock);
  
  
              //set the value = 0
              byte[] zeroValue = {0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0,0,0,};
              //save this value 
                              mClassic.writeBlock(firstBlock, zeroValue);
  
              //increment the value and store it
              this.mClassic.increment(firstBlock, 1);
              this.mClassic.transfer(firstBlock);
  
              // read the incremented value by converting it in integer from bytearray
              b = readSector(firstBlock);
              data = b.toByteArray();
              value = 0;
              for (int i = 0; i &lt; data.length; i++)
              {
                 value = (value &lt;&lt; 8) + (data[i] &amp; 0xff);
              }
              Log.i("MIFARE CLASSIC", "After increment " + value);
          }
          mClassic.close();
  </code></pre>
  
  <p>I have returned <code>tranceive failed</code> at   <code>this.mClassic.increment(firstBlock, 1);</code>
  I don't understand what I am doing wrong...who can help me?
  Thanks a lot.</p>