Module "QtMobility.gallery" is not installed
-
hi, i want to use QtMobility.gallery to find all videos in android device. and i must download and install QtMobility.gallery to use it but i got an error when i click on download link
http://doc.qt.nokia.com/qt-mobility-snapshot/installation.htmlerrror:
This site can’t be reached doc.qt.nokia.com’s DNS address could not be found. Diagnosing the problem.
DNS_PROBE_POSSIBLEi used vpn too
sorry for my english is still bad (:
-
@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
-
@qAminzzz said in Module "QtMobility.gallery" is not installed:
This site can’t be reached doc.qt.nokia.com’s DNS address could not be found
Yes, because it does not exist anymore.
Qt does not belong to Nokia for long time already.
To my knowledge there is no QtMobility anymore. -
Hi, and welcome!
@qAminzzz said in Module "QtMobility.gallery" is not installed:
i want to use QtMobility.gallery to find all videos in android device
Qt Mobility was designed for Nokia's old phone platforms (S60, Symbian, Maemo, Harmattan, MeeGo). It never supported Android.
See https://doc.qt.io/qt-5/android.html for Android support.
-
@JKSH thanks (:
i runned qt in android. now i just wanna get all videos in android device to make an application. something like gallery.
i hope to do this with qt code. but i think there is a java code
please help me to do this with qt -
@qAminzzz Use https://doc.qt.io/qt-5/qstandardpaths.html to get the paths to video/image locations.
Don't forget to request access rights from Android. -
@jsulm thanks for link.
i searched in this link and i made this code :QStringList movies = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation); foreach(QString file, movies) { qInfo() << "path: " << file; } output: path: "/storage/emulated/0/Pictures" path: "/storage/emulated/0/Android/data/org.qtproject.example.videoTesting/files/Pictures"
i think it did not work correctly because in "/storage/emulated/0/Pictures" directory there is no all my android device pictures
please help me
-
@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? -
@qAminzzz
i can show video in my app with these codesVideo { 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 -
@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.
-
@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 thembut 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? -
You can also use https://doc.qt.io/qt-5/qdiriterator.html which is reqursive
-
@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. -
@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