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

Include file in package after clicking button

Scheduled Pinned Locked Moved Solved Mobile and Embedded
13 Posts 4 Posters 1.4k Views
  • 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.
  • Bhushan_SureB Offline
    Bhushan_SureB Offline
    Bhushan_Sure
    wrote on last edited by
    #1

    Hello all,
    So i am making one app, so after deploying that app in mobile, there will be one button , after clicking that button one file from Mobile file manager should be include in that app bundle and that file should not be present in mobile, basically file should move from file manager to app bundle.
    Is there anything like tha,t so i can proceed.

    Thank you in Advance :)

    A 1 Reply Last reply
    0
    • Bhushan_SureB Bhushan_Sure

      Hello all,
      So i am making one app, so after deploying that app in mobile, there will be one button , after clicking that button one file from Mobile file manager should be include in that app bundle and that file should not be present in mobile, basically file should move from file manager to app bundle.
      Is there anything like tha,t so i can proceed.

      Thank you in Advance :)

      A Offline
      A Offline
      ambershark
      wrote on last edited by
      #2

      @Bhushan_Sure I'm not understanding the question, but from what I think it's asking, you are asking if you can take a file from the mobile device and include it in the app bundle for your application that was loaded on the device?

      If I'm reading that correctly then no there is no way to do that. You should not be able to modify the appbundle once it's signed and loaded on the device.

      My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

      Bhushan_SureB 1 Reply Last reply
      2
      • A ambershark

        @Bhushan_Sure I'm not understanding the question, but from what I think it's asking, you are asking if you can take a file from the mobile device and include it in the app bundle for your application that was loaded on the device?

        If I'm reading that correctly then no there is no way to do that. You should not be able to modify the appbundle once it's signed and loaded on the device.

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

        @ambershark yes question is right, so we can't include it in bundle, but can we save a file inside app internal storage, for example, gallery pic saving inside app.
        is that possible ? gallery pic is an example, similar to that something ?

        1 Reply Last reply
        0
        • 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