Another Update:

Scenario: Samsung GS2 without SD card
External storage path: /mnt/sdcard

System tells me I've got 6.34gb of free space. API tells me that I have
175922186204271mb of free space (they should be  6492.16mb)


On Sun, Sep 16, 2012 at 9:25 PM, Francesco Colombo <
[email protected]> wrote:

> Another update:
>
> Android SDK say:
> Every Android-compatible device supports a shared "external storage" that
> you can use to save files. This can be a removable storage media (such as
> an SD card) or an internal (non-removable) storage.
>
> So basically calling *Environment.ExternalStorageDirectory* should return
> a valid path for either for *removable* or *internal* storage right?
> I'am quite sure about this because my Samsung G2 doesn't have a SD card
> and I'm getting reasonable values. :(
>
> So my first question: "Is StatFS working on JellyBean?" remains valid!
>
>
>
>
>
> On Sun, Sep 16, 2012 at 9:16 PM, Francesco Colombo <
> [email protected]> wrote:
>
>> Ok, I think I've discovered what's the problem is. My bad knowledge of
>> android :(
>>
>> Tests have been done on a device which has not a real SD card. I'm a bit
>> confused on how android defines spaces where apps can write into it (local
>> and external).
>>
>> I need to investigate more. Any help is appreciate on explaining which
>> options are available for an android app on "where I can write files"
>>
>>
>> On Sun, Sep 16, 2012 at 8:54 PM, Francesco Colombo <
>> [email protected]> wrote:
>>
>>> Further investigations denotes that 
>>> using*Enviornment.ExternalStorageDirectory.Path
>>> *on jellybean return as folder */storage *in place of */mnt/sdcard. *Is
>>> it right?
>>>
>>>
>>> On Sat, Sep 15, 2012 at 6:23 PM, Francesco Colombo <
>>> [email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> I'm developing an app which on the first run it will download a big
>>>> file from FTP. Before the download begin, the user is asked where to save
>>>> the file. One can use either local or external storage.
>>>> When the user select "external storage" the app will use as root the *
>>>> Application.Context.ExternalCacheDir.Path* variable. That is! In this
>>>> way all content written into this folder *will be deleted* once the
>>>> app is removed from the device.
>>>>
>>>> Here my code to get available storage size:
>>>>
>>>> *string *external_path = Path.Combine(*
>>>> Application.Context.ExternalCacheDir.Path*, "/mypath");
>>>> *
>>>> *
>>>> *ulong *totalFreeSpace = 0;
>>>> *StatFs *stats = *new* Stats(external_path);
>>>> totalFreeSpace = (*ulong*)stats.AvailableBlocks * stats.BlocksSize;
>>>>
>>>> All this stuff is good on Android +2.2. I'm facing a
>>>> strange behavior ONLY on JellyBean. It seems that StatFs will return the
>>>> same available blocks value for either internal 
>>>> (use*Application.Context.FilesDir.Path
>>>> *in place of *Application.Context.ExternalCacheDir* )or external path.
>>>>
>>>> Anyone can confirm this? Am I missing something?
>>>>
>>>> thanks
>>>> Francesco
>>>>
>>>
>>>
>>
>
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to