Monday, March 14, 2011

[android-developers] Re: Display sd card size

So what is the best soln for Android 3.0?

On Mar 3, 2:22 pm, Dianne Hackborn <hack...@android.com> wrote:
> For overall data about a filesystem, you can use this class:http://developer.android.com/reference/android/os/StatFs.html
>
> Use the path you retrieve with Environment.getExternalStoragePath().
>
> Warning: the APIs return number of blocks in integers.  Be sure you cast
> this to a long before multiplying with the block size, to avoid overflow
> errors.
>
> Also note that starting with Android 3.0 the "SD card" may not actually be
> its own partition, in which case this would be telling you the total size
> and amount used of all internal storage.
>
>
>
>
>
>
>
>
>
> On Tue, Mar 1, 2011 at 3:37 AM, shobi <s.shobanasubbu...@gmail.com> 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
> >  unable to get the used space of sdcard and free space in sdcard,  and
> > also 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 android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscribe@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

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

No comments:

Post a Comment