Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Include file in package after clicking button
Forum Updated to NodeBB v4.3 + New Features

Include file in package after clicking button

Scheduled Pinned Locked Moved Solved Mobile and Embedded
13 Posts 4 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • dheerendraD Offline
    dheerendraD Offline
    dheerendra
    Qt Champions 2022
    wrote on last edited by
    #4

    As @ambershark said, you cann't change the bundle. This is not specific to Qt. In general app bundling work like this. You can save the data. What is the contents of file ? What is the size of this file content ?

    Dheerendra
    @Community Service
    Certified Qt Specialist
    http://www.pthinks.com

    Bhushan_SureB 1 Reply Last reply
    1
    • dheerendraD dheerendra

      As @ambershark said, you cann't change the bundle. This is not specific to Qt. In general app bundling work like this. You can save the data. What is the contents of file ? What is the size of this file content ?

      Bhushan_SureB Offline
      Bhushan_SureB Offline
      Bhushan_Sure
      wrote on last edited by
      #5

      @dheerendra Sir contents of file is, it is text file and i want to include it in app internal storage then from there i have to read the data of the file.

      1 Reply Last reply
      0
      • dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by dheerendra
        #6

        Same app is going to read or different app should read the file? Are you trying to share the data between two different apps ?

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        Bhushan_SureB 1 Reply Last reply
        1
        • dheerendraD dheerendra

          Same app is going to read or different app should read the file? Are you trying to share the data between two different apps ?

          Bhushan_SureB Offline
          Bhushan_SureB Offline
          Bhushan_Sure
          wrote on last edited by
          #7

          @dheerendra same app should read the data, like in watsapp, whenever we set our profile picture, the profile picture goes into watsapp memory, even after deleting that photo from gallery, the photo will be there, like that.

          J.HilkJ 1 Reply Last reply
          0
          • dheerendraD Offline
            dheerendraD Offline
            dheerendra
            Qt Champions 2022
            wrote on last edited by
            #8

            You would like to have persistent storage for your app. Across the multiple launch of the applications you should be able to see old data. If this the case you can do it.

            Dheerendra
            @Community Service
            Certified Qt Specialist
            http://www.pthinks.com

            1 Reply Last reply
            2
            • Bhushan_SureB Bhushan_Sure

              @dheerendra same app should read the data, like in watsapp, whenever we set our profile picture, the profile picture goes into watsapp memory, even after deleting that photo from gallery, the photo will be there, like that.

              J.HilkJ Offline
              J.HilkJ Offline
              J.Hilk
              Moderators
              wrote on last edited by
              #9

              @Bhushan_Sure
              Qt has the QStandardPath class that is more ore less made for this.

              QString QStandardPaths::writableLocation(QStandardPaths::StandardLocation type)

              with

              QStandardPaths::AppDataLocation as type should be what you're looking for.
              Keep in mind, you may have to create the path first(like on iOS) but that is the place your appliaction should store it's data. The path/folder will exist, as long as your app is installed on the device. It will remain during updates but will be lost with an app deinstall (at least on iOS and Android)


              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              Bhushan_SureB 2 Replies Last reply
              3
              • J.HilkJ J.Hilk

                @Bhushan_Sure
                Qt has the QStandardPath class that is more ore less made for this.

                QString QStandardPaths::writableLocation(QStandardPaths::StandardLocation type)

                with

                QStandardPaths::AppDataLocation as type should be what you're looking for.
                Keep in mind, you may have to create the path first(like on iOS) but that is the place your appliaction should store it's data. The path/folder will exist, as long as your app is installed on the device. It will remain during updates but will be lost with an app deinstall (at least on iOS and Android)

                Bhushan_SureB Offline
                Bhushan_SureB Offline
                Bhushan_Sure
                wrote on last edited by
                #10

                @J.Hilk @dheerendra Thank you so much for the support, I will look into QstandardPath :)

                1 Reply Last reply
                1
                • J.HilkJ J.Hilk

                  @Bhushan_Sure
                  Qt has the QStandardPath class that is more ore less made for this.

                  QString QStandardPaths::writableLocation(QStandardPaths::StandardLocation type)

                  with

                  QStandardPaths::AppDataLocation as type should be what you're looking for.
                  Keep in mind, you may have to create the path first(like on iOS) but that is the place your appliaction should store it's data. The path/folder will exist, as long as your app is installed on the device. It will remain during updates but will be lost with an app deinstall (at least on iOS and Android)

                  Bhushan_SureB Offline
                  Bhushan_SureB Offline
                  Bhushan_Sure
                  wrote on last edited by
                  #11

                  @J.Hilk @ambershark @dheerendra Hello, I resolved yesterday's doubts, I just Played with "Qfile" and "QstandardPath" and it is done, Solution is below:

                  1) auto path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
                  

                  By the above part, i got the path where android app's data is been stored and it is not visible in device, it is not visible anywhere except if the phone is rooted.

                  /storage/emulated/0/
                  

                  This path gave me the root directory path of an android operating system.

                  1. So, i placed a file in root directory and moved it into AppDataLocation.

                  2. and atlast i deleted the original file.

                  1 Reply Last reply
                  0
                  • dheerendraD Offline
                    dheerendraD Offline
                    dheerendra
                    Qt Champions 2022
                    wrote on last edited by
                    #12

                    Cool. It is good that problem is resolved. Just suggestion. If data you are storing is structured information, you can consider SQLLiteDB as well.

                    Dheerendra
                    @Community Service
                    Certified Qt Specialist
                    http://www.pthinks.com

                    Bhushan_SureB 1 Reply Last reply
                    0
                    • dheerendraD dheerendra

                      Cool. It is good that problem is resolved. Just suggestion. If data you are storing is structured information, you can consider SQLLiteDB as well.

                      Bhushan_SureB Offline
                      Bhushan_SureB Offline
                      Bhushan_Sure
                      wrote on last edited by
                      #13

                      @dheerendra okay Sir :)

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved