When I use the mifare increment and decrement functions of MFBlock I get unexpected results when using an external Omnikey 5321 reader.
e.g. when the card contains the value 0 and I increment with 100 the new value will be 1677721600. When seen as a byteArray this also contains 0x64, but at the wrong place.
The decrement function fails in a similar way.
According to the SDK documents both the increment and the decrement should return the new values, but the increment always returns 0 and the decrement always returns 4.
When I use the simulated mifare card, that writes to a file, the increment and decrement functions work like expected.
Any suggestions how to solve this?
Yes I used MFStandardConnection. I had the firmware upgraded to make it work.
If you also need a firmware upgrade try if your Nokia Service point can do it for you.
Note that using the MFStandardConnection in a midlet is not a very safe method as you need to provide the Mifare keys in the midlet and it would be easy for somebody to retrieve the keys from your midlet.
Our next step is to remove the MFStandardConnection and to make a JCOP applet and let the Midlet talk to the JCOP applet. I don't know if you also need the new firmware version for this approach.