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