Something like this should work:

                StatFs stat = new
StatFs(Environment.getExternalStorageDirectory().getPath());
                long bytesAvailable = (long)stat.getBlockSize() *
(long)stat.getBlockCount();
                long megAvailable = bytesAvailable / 1048576;

the cast to long is necessary for cards larger than 4Gig.

On Mar 19, 8:36 am, mmkr <[email protected]> wrote:
> Hi all,
>
>         In my application i want to display all the properties of the
> sdcard like sizeof sdcard, used space in sdcard , free space etc.. I'm
> able to get the used space of sdcard, but unable to get the total size
> of sdcard ( size given at the creation time of AVD ). How can i do
> that?
>
> Thanks in advance.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to