Hi

Samsung!
Read Jon's explanation here:
http://mono-for-android.1047100.n5.nabble.com/detect-SD-Card-path-td5710218.html

there are few workarounds. See if those help

cheers

mel
On 2012.09.16 21:30, Francesco Colombo wrote:
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] <mailto:[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] <mailto:[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]
        <mailto:[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]
            <mailto:[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


--
Miljenko Cvjetko dipl.ing. ET
        Direktor/CEO
        Projektant rjes(enja/Solution Architect 
        Razvojni programer/Senior developer
        Voditelj projekta/Project Manager

IX juz(na obala 13
Kajzerica Zagreb
T: 385 1 7775555
M: 385 91 557 447 3
F: 385 1 7779556
e: [email protected]
w: http://www.holisticware.net

_______________________________________________
Monodroid mailing list
[email protected]

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

Reply via email to