Re: [android-developers] Re: Problem computing the free space on the external card - only with a single installation

2010-08-18 Thread Julius Spencer
Hi, I have this same issue; my check evaluates available space as negative in rare cases. I'm not sure yet whether I can take an absolute value. This must be a problem which has happened before. Anyone else come across this? Regards, Julius. On 16/08/2010, at 7:52 AM, Bob Kerns wrote: Two

Re: [android-developers] Re: Problem computing the free space on the external card - only with a single installation

2010-08-18 Thread Kostya Vasilyev
The code above multiplies two ints and casts them to long. If the intermediate result is over 2Gb, you'll get a negative number. Try multiplying long values instead: long byteCount = blockSize * (long) avlBlocks; -- Kostya Vasilyev -- http://kmansoft.wordpress.com 19.08.2010 0:09 пользователь

Re: [android-developers] Re: Problem computing the free space on the external card - only with a single installation

2010-08-18 Thread Fabrizio Giudici
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 8/18/10 22:37 , Kostya Vasilyev wrote: The code above multiplies two ints and casts them to long. If the intermediate result is over 2Gb, you'll get a negative number. Try multiplying long values instead: long byteCount = blockSize * (long)

Re: [android-developers] Re: Problem computing the free space on the external card - only with a single installation

2010-08-18 Thread Julius Spencer
Oops! Thank you Kostya! On 19/08/2010, at 8:37 AM, Kostya Vasilyev wrote: The code above multiplies two ints and casts them to long. If the intermediate result is over 2Gb, you'll get a negative number. Try multiplying long values instead: long byteCount = blockSize * (long)

[android-developers] Re: Problem computing the free space on the external card - only with a single installation

2010-08-15 Thread Bob Kerns
Two possibilities come to mind. First, perhaps the Dell Streak is one of the phones that has more than one set of SD storage, and mounts the true external one on a subirectory under getExternalStorageDirectory(). But the more likely possibility is that the phone has the problem that this