title: Mifare Classic 1k Card write Failed with Error java.ioexception transceive failed in Android Nexus S
body: <p>when i am trying to write a data in Mifare classic 1k card, on Nexus S with android 2.3.3 API level 10, I am having this error. transceive failed.
  my code is</p>
  
  <pre><code>private View.OnClickListener write_butClickListener =new View.OnClickListener() {
  
      @Override
      public void onClick(View v) {
  
  
          IntentFilter ndef=new IntentFilter(NfcAdapter.ACTION_TECH_DISCOVERED );
          try{
              ndef.addDataType("*/*");
          }catch(MalformedMimeTypeException e){
              throw new RuntimeException("fail",e);
          }
  
          mFilters=new IntentFilter[]{ndef,};
          // Setup a tech list for all NfcF tags
          mTechLists = new String[][] { new String[] { MifareClassic.class
                  .getName() } };
  
          Intent intent=getIntent();
          String action=intent.getAction();
          if(NfcAdapter.ACTION_TECH_DISCOVERED.equals(action) ){
          String msg="Discovered Tag with Intent " + intent;
          status_Data.setText(msg);
          Tag tagFromintent=intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
  
          MifareClassic mfc=MifareClassic.get(tagFromintent);
          byte[] data;
          try{
              mfc.connect();
              boolean auth = false;
              String cardData = null;
              status_Data.setText("Authenticating the Tag..");
  
              auth = mfc.authenticateSectorWithKeyA(1,
                      MifareClassic.KEY_DEFAULT);
              if (auth){
                  status_Data.setText("Authenticated");
  
                   String text       = "Hello, World!";
                      String lang       = "en";
                      byte[] textBytes  = text.getBytes();
                      byte[] langBytes  = lang.getBytes("US-ASCII");
                      int    langLength = langBytes.length;
                      int    textLength = textBytes.length;
                      byte[] payload    = new byte[1 + langLength + textLength];
  
                      // set status byte (see NDEF spec for actual bits)
                      payload[0] = (byte) langLength;
  
                      // copy langbytes and textbytes into payload
                      System.arraycopy(langBytes, 0, payload, 1,              langLength);
                      System.arraycopy(textBytes, 0, payload, 1 + langLength, textLength);
                      if (!mfc.isConnected()) mfc.connect();
  
                                      mfc.writeBlock(1, payload);
                                      mfc.close();
                  showMessage("written");
              }else{
                  showMessage("Authetication Failed");
                  status_Data.setText("");
              }
  
          }
          catch(IOException e){
              status_Data.setText(e.toString());
  
          }
  
  
  
          }else{
              showMessage("Nothing to read");
          }
      }
  };
  </code></pre>
  
  <p>any pointers</p>