Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 2 Support (Qt 5) › free space crossplatform

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #18669

    Bas

    hi,

     

    i need to download a huge amount of data, and i need to check if there is free space for it.

    what is the best solution or is there any functionality allready?

     

    thanx,

    Bas

    #18679

    Günther
    Felgo Team

    Hi Bas,

    downloading a huge amount of data with your mobile app can prove a bit troublesome. E.g. you might not want to rely on online connectivity too much for a mobile app, as bad internet connection then breaks functionality.

    As for your question: We do not have a built in solution ready to check for free disk space. It is required to add custom Qt C++ code and do file system check with available Qt types.

    Best,
    Günther

    #18680

    Bas

    hi Gunther,

    i tried some code:

        QStorageInfo storage( m_writablePath );
    
        if (storage.isValid() && storage.isReady())
        {
            list << storage.name();
            list << storage.fileSystemType();
            list << QString::number( storage.bytesAvailable() );
            list << QString::number( storage.bytesTotal() );
        }
    

    but it did not work on android.

    and saw this:

    https://bugreports.qt.io/browse/QTBUG-60215

     

     

    will try something else.

    i think i will call native functions on android to get proper info

     

    #18685

    Günther
    Felgo Team

    Yes, seems the bug affects this use-case. If you prefer to add a custom solution by hand, you can use pre-processor macros as well, to use different code on another platform:

    #if !defined(Q_OS_ANDROID)
    // do this if not android
    #else
    // do this if android
    #endif

     

Viewing 4 posts - 1 through 4 (of 4 total)

RSS feed for this thread

You must be logged in to reply to this topic.