Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Module "QtMobility.gallery" is not installed
Forum Updated to NodeBB v4.3 + New Features

Module "QtMobility.gallery" is not installed

Scheduled Pinned Locked Moved Solved Installation and Deployment
qmlandroidqt 5qtmobility
21 Posts 3 Posters 3.5k Views 2 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.
  • jsulmJ jsulm

    @qAminzzz Does your app request access to images storage?

    Q Offline
    Q Offline
    qAminzzz
    wrote on last edited by qAminzzz
    #12

    @jsulm i just did it

    QtAndroid::PermissionResultMap resultHash = QtAndroid::requestPermissionsSync(QStringList(
                                                                                      {
                                                                                          "android.permission.WRITE_EXTERNAL_STORAGE",
                                                                                          "android.permission.READ_EXTERNAL_STORAGE"
                                                                                      }
                                                                                      ));
    

    and works fine
    should i request permission more?

    Q 1 Reply Last reply
    0
    • Q qAminzzz

      @jsulm i just did it

      QtAndroid::PermissionResultMap resultHash = QtAndroid::requestPermissionsSync(QStringList(
                                                                                        {
                                                                                            "android.permission.WRITE_EXTERNAL_STORAGE",
                                                                                            "android.permission.READ_EXTERNAL_STORAGE"
                                                                                        }
                                                                                        ));
      

      and works fine
      should i request permission more?

      Q Offline
      Q Offline
      qAminzzz
      wrote on last edited by qAminzzz
      #13

      @qAminzzz
      i can show video in my app with these codes

          Video
          {
              id: video
              anchors.fill: parent
              source: "file:///storage/emulated/0/download/video.mp4"
              visible: true
              volume: 20
      
      
              MouseArea
              {
                  anchors.fill: parent
                  onClicked:
                  {
                      video.play()
                  }
              }
      

      and this works fine.
      now i want create a class and get all videos in android device with a function and return them to Video.source

      jsulmJ 1 Reply Last reply
      0
      • Q qAminzzz

        @qAminzzz
        i can show video in my app with these codes

            Video
            {
                id: video
                anchors.fill: parent
                source: "file:///storage/emulated/0/download/video.mp4"
                visible: true
                volume: 20
        
        
                MouseArea
                {
                    anchors.fill: parent
                    onClicked:
                    {
                        video.play()
                    }
                }
        

        and this works fine.
        now i want create a class and get all videos in android device with a function and return them to Video.source

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #14

        @qAminzzz said in Module "QtMobility.gallery" is not installed:

        now i want create a class and get all videos in android device with a function and return them to Video.source

        Then you can go through all the paths where the user can store something (not only images/videos locations) and then use https://doc.qt.io/qt-5/qdir.html#entryList-1 for each of these paths to get the files there and filter those by file extension.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        Q 1 Reply Last reply
        0
        • jsulmJ jsulm

          @qAminzzz said in Module "QtMobility.gallery" is not installed:

          now i want create a class and get all videos in android device with a function and return them to Video.source

          Then you can go through all the paths where the user can store something (not only images/videos locations) and then use https://doc.qt.io/qt-5/qdir.html#entryList-1 for each of these paths to get the files there and filter those by file extension.

          Q Offline
          Q Offline
          qAminzzz
          wrote on last edited by
          #15

          @jsulm this link shows to get all files in a directory
          but might be there a directory in that directory
          or might be there 10 directory in one directory and we can't search all them

          but in device gallery there is all media like screen shots, apps, downloads and ...
          but in this way we can just see all files in a directory not in device
          is there any way to do gallery device work?

          1 Reply Last reply
          0
          • jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #16

            You can also use https://doc.qt.io/qt-5/qdiriterator.html which is reqursive

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • Q Offline
              Q Offline
              qAminzzz
              wrote on last edited by
              #17

              no which does not my request ):, may i have to use java ):
              thank you for help (:

              jsulmJ 1 Reply Last reply
              0
              • Q qAminzzz

                no which does not my request ):, may i have to use java ):
                thank you for help (:

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #18

                @qAminzzz said in Module "QtMobility.gallery" is not installed:

                no which does not my request

                Not sure what this means?

                "but in device gallery there is all media like screen shots, apps, downloads and" - because the gallery app collects the files from many different locations on the device...
                I don't know whether there is an Java API on Android for that.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                Q 1 Reply Last reply
                0
                • jsulmJ jsulm

                  @qAminzzz said in Module "QtMobility.gallery" is not installed:

                  no which does not my request

                  Not sure what this means?

                  "but in device gallery there is all media like screen shots, apps, downloads and" - because the gallery app collects the files from many different locations on the device...
                  I don't know whether there is an Java API on Android for that.

                  Q Offline
                  Q Offline
                  qAminzzz
                  wrote on last edited by
                  #19

                  @jsulm yeah gallery does it. how can i do this me too?
                  can i search all directories with QDiriterator ?

                  im new in qt (just 4 month). i know what you feel -
                  thank you for help

                  jsulmJ 1 Reply Last reply
                  0
                  • Q qAminzzz

                    @jsulm yeah gallery does it. how can i do this me too?
                    can i search all directories with QDiriterator ?

                    im new in qt (just 4 month). i know what you feel -
                    thank you for help

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #20

                    @qAminzzz said in Module "QtMobility.gallery" is not installed:

                    can i search all directories with QDiriterator ?

                    yes, at least those where your app has read access

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    Q 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @qAminzzz said in Module "QtMobility.gallery" is not installed:

                      can i search all directories with QDiriterator ?

                      yes, at least those where your app has read access

                      Q Offline
                      Q Offline
                      qAminzzz
                      wrote on last edited by qAminzzz
                      #21

                      @jsulm thank you so much
                      it worked with these code:

                      function:

                      void searchPaths(QVariant path)
                      {
                          QStringList files; // add files to this ( paths )
                          QStringList filter; // mp4 files filter
                      
                          filter << "*.mp4"; // add filter
                      
                          qInfo("-----");
                      
                          QDirIterator dir(path.toString(), filter, QDir::Files, QDirIterator::Subdirectories); // get all files in directory
                          while (dir.hasNext())
                          {
                              qInfo() << dir.next();
                              files << dir.next(); // 
                          }
                      }
                      
                      

                      use:

                      searchPaths("enter path here") 
                      
                      

                      now i can sleep easy. thanks

                      1 Reply Last reply
                      1

                      • Login

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