Reply To: DESFireEV1 getFreeMemory() returns more available memory than getTotalMemory()

Forum MIFARE SDK DESFireEV1 getFreeMemory() returns more available memory than getTotalMemory() Reply To: DESFireEV1 getFreeMemory() returns more available memory than getTotalMemory()

Re: DESFireEV1 getFreeMemory() returns more available memory than getTotalMemory()

1. February 2017 at 15:13
Hello,

Thank you for your comprehensive explanation. I am perfectly aware of the intended meaning of getFreeMemory and getTotalMemory, that's the reason why I asked in the first place, because I am experiencing the behavior I described. We are on the same page here, so that's good.

I am using an empty DESFire EV 1 (4K) card, with a Sony Xperia Z3 Compact (D5803) device, with Android 6.0.1 version.

I believe you are reading a smaller value for getFreeMemory() than for getTotalMemory() since your tag is not empty. If you were to read the same card but empty, I reckon you would find that the value of getFreeMemory() is greater than that of getTotalMemory(). I imagine this is so because the name of "getFreeMemory" got swapped with "getTotalMemory".

I just tested with the same card, but this time with some data in it, and effectively the amount returned by getFreeMemory() is lesser than getTotalMemory().

getFreeMemory() with empty tag: 4864
getTotalMemory() with empty tag: 4096
getFreeMemory() with data on the tag: 3576
getTotalMemory() with data on the tag: 4096

I recommend that you try the same test but with an empty card and watch the values returned.
+ 0  |  - 0