[Solved] iOS and Android Writeable and Persistent folders ??



  • I'm trying to write some XML and CSV format files to my Nexxus7 device. I can write to the device and any files that are written can be accessed during the debug session.

    On restarting the program wth the Qt debugger, files created are NOT there.

    On tapping the icon on the device to restart, any file created during the debug session is there.

    Are files created during a debug session not persistent? If so, is there any way to change this behavior?

    I've tried all the following data/documents with the same results...

    /*
      // paths that could be used to read or write user records and app startup-restore configuration
      QString docsPathW = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
      qDebug() << "Main.cpp::writableLocation::DocumentsLocation: " << docsPathW ;
    
      QString dataPathW = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
      qDebug() << "Main.cpp::writableLocation::DataLocation: " << dataPathW ;
    
      // the generic data directory..always available per qt docs..no test for ifexists needed ??
      QString genericdataPath = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation)[0];
      qDebug() << "Main.cpp::standardpath::GenericDataLocation: " << genericdataPath ;
    
      // the cache directory..always available per qt docs..no test for ifexists needed ??
      QString cachePath = QStandardPaths::standardLocations(QStandardPaths::CacheLocation)[0];
      qDebug() << "Main.cpp::standardpath::CacheLocation: " << cachePath ;
    
      // the generic cache directory..always available per qt docs..no test for ifexists needed ??
      QString genericcachePath = QStandardPaths::standardLocations(QStandardPaths::GenericCacheLocation)[0];
      qDebug() << "Main.cpp::standardpath::GenericCacheLocation: " << genericcachePath ;
    
      // the home directory..always available per qt docs..no test for ifexists needed ??
      QString homepath = QStandardPaths::standardLocations(QStandardPaths::HomeLocation)[0];
      qDebug() << "Main.cpp::standardpath::HomeLocation: " << homepath ;
    
      // the documents directory..always available per qt docs..no test for ifexists needed ??
      QString docsPath = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation)[0];
      qDebug() << "Main.cpp::standardpath::DocumentsLocation: " << docsPath ;
    
      // the data directory..not specified if always available per qt docs..test for ifexists needed ??
      QString dataPath = QStandardPaths::standardLocations(QStandardPaths::DataLocation)[0];
      qDebug() << "--Main.cpp::standardpath::DataLocation: " << dataPath ;
    */
      // the documents directory..always available per qt docs..no test for ifexists needed ??
      QString docsPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
      qDebug() << "Main.cpp::standardpath::DocumentsLocation: " << docsPath ;
    
      // the data directory..not specified if always available per qt docs..test for ifexists needed ??
      QString dataPath = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
      qDebug() << "--Main.cpp::standardpath::DataLocation: " << dataPath ;
    

  • Qt Champions 2016

    What is your Qt Creator and Qt version? That may happen for old version of Qt Creator for Android. It did a uninstall of package before install new one. Therefore, it will remove files within the package directory. But new version should not have this problem.



  • @benlau said:

    What is your Qt Creator and Qt version?

    Qt 5.3.1 and Creator 3.3.2

    Can I update to a newer version of Creator without using a newer Qt version?


  • Qt Champions 2016

    @PSI_lbc

    @PSI_lbc said:

    Qt 5.3.1 and Creator 3.3.2

    Can I update to a newer version of Creator without using a newer Qt version?

    yes. After launched the new Creator, go to Preference , "Build & Run" -> "Qt Versions". Press "Add" then you may choose old version.



  • @benlau

    Thx.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.