<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Programatically iterate over public Files in Android]]></title><description><![CDATA[<p dir="auto">I want to read several public folders on a Android SDK34 device and use the content to build a app internal DB. Examples are the DCIM folder, Documents or Downloads. Which non interactive Qt file access APIs might help with that task?</p>
<p dir="auto">The Qt-6.11.1 Application has in CMakeLists.txt following permissions:<br />
QT_ADD_ANDROID_PERMISSION( ${PROJECT_NAME}<br />
NAME android.permission.READ_INTERNAL_STORAGE<br />
android.permission.WRITE_INTERNAL_STORAGE<br />
android.permission.READ_EXTERNAL_STORAGE<br />
android.permission.WRITE_EXTERNAL_STORAGE<br />
android.permission.READ_MEDIA_IMAGES<br />
android.permission.READ_MEDIA_AUDIO<br />
android.permission.READ_MEDIA_VIDEO<br />
android.permission.INTERNET<br />
)</p>
<p dir="auto">The QML FileDialog, which is not programatical, does see all files very nicely. It probably uses SAF or MediaStorage according to a post from 2023. What is the current stage of support. Which API allows to use that in a programatic way?</p>
<p dir="auto">For the record: QStandardPaths::standardLocations(type) returns only app specific paths.</p>
<p dir="auto">Before the QML FileDialog I tried without much luck:<br />
The old Android QtAndroidPrivate::requestPermissions() are gone. Even though it is mentionened in the private header file<br />
&lt;QtCore/private/qandroidextras_p.h&gt;, this symbol is not resolved by the linker on arm64-v8a using Qt Creator 20.0.0 (RH Linux)<br />
/opt/android-sdk/ndk/27.2.12479018/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android32<br />
ld.lld: error: undefined symbol: requestPermissionsInternal(QList&lt;QString&gt; const&amp;)</p>
]]></description><link>https://forum.qt.io/topic/164922/programatically-iterate-over-public-files-in-android</link><generator>RSS for Node</generator><lastBuildDate>Fri, 31 Jul 2026 23:22:13 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164922.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 23 Jul 2026 10:42:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Programatically iterate over public Files in Android on Fri, 31 Jul 2026 20:54:53 GMT]]></title><description><![CDATA[<p dir="auto">Will next look into:<br />
<a href="https://www.qt.io/blog/qt-for-android-storage-updates" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.qt.io/blog/qt-for-android-storage-updates</a></p>
]]></description><link>https://forum.qt.io/post/839478</link><guid isPermaLink="true">https://forum.qt.io/post/839478</guid><dc:creator><![CDATA[beku2]]></dc:creator><pubDate>Fri, 31 Jul 2026 20:54:53 GMT</pubDate></item><item><title><![CDATA[Reply to Programatically iterate over public Files in Android on Thu, 30 Jul 2026 17:02:07 GMT]]></title><description><![CDATA[<p dir="auto">Give up the extensive MANAGE_EXTERNAL_STORAGE permission (which is stuck because it doesn't have proper callback wiring in Qt) and instead use SAF (ACTION_OPEN_DOCUMENT_TREE with takePersistableUriPermission) for one-time folder selection, or the MediaStore API if it's just media files.</p>
]]></description><link>https://forum.qt.io/post/839463</link><guid isPermaLink="true">https://forum.qt.io/post/839463</guid><dc:creator><![CDATA[Nils Sjoberg]]></dc:creator><pubDate>Thu, 30 Jul 2026 17:02:07 GMT</pubDate></item><item><title><![CDATA[Reply to Programatically iterate over public Files in Android on Wed, 29 Jul 2026 06:56:19 GMT]]></title><description><![CDATA[<p dir="auto">The flow in my app is like:<br />
Android SDK 34 -&gt; QML-&gt; check permission -&gt; if not: show reason why as text and ask for agreement -&gt; requestPermission() (now copied from Qt sources into my app_data.cpp)</p>
<p dir="auto">debug output in QtCreator:<br />
I/app_data.cpp:506 requestPermissionsInternal(): after  AndroidDeadlockProtector<br />
I/app_data.cpp:513 requestPermissionsInternal(): after promise-&gt;start()<br />
I/app_data.cpp:476 nextRequestCode(): code:225<br />
I/app_data.cpp:519 requestPermissionsInternal(): after locker.unlock()<br />
I/app_data.cpp:529 operator()(): perm:android.permission.MANAGE_EXTERNAL_STORAGE<br />
I/app_data.cpp:543 requestPermissionsInternal(): after releaseAndroidDeadlockProtector<br />
I/app_data.cpp:632 requestPermissions(): after oyjlArgsQmlRequestPermissions(android.permission.MANAGE_EXTERNAL_STORAGE)<br />
I/app_data.cpp:537 operator()(): after activity().callMethod requestCode:225<br />
W/default : Found no valid pending permission request for request code 225</p>
<p dir="auto">... the app is keeps frozen after (QFuture result; ...) result.waitForFinished();</p>
]]></description><link>https://forum.qt.io/post/839440</link><guid isPermaLink="true">https://forum.qt.io/post/839440</guid><dc:creator><![CDATA[beku2]]></dc:creator><pubDate>Wed, 29 Jul 2026 06:56:19 GMT</pubDate></item><item><title><![CDATA[Reply to Programatically iterate over public Files in Android on Fri, 24 Jul 2026 18:33:31 GMT]]></title><description><![CDATA[<p dir="auto">QDir -&gt; QFileInfoList and QDirIterator show mostly app dirs and files and some public dirs without file names.</p>
]]></description><link>https://forum.qt.io/post/839360</link><guid isPermaLink="true">https://forum.qt.io/post/839360</guid><dc:creator><![CDATA[beku2]]></dc:creator><pubDate>Fri, 24 Jul 2026 18:33:31 GMT</pubDate></item><item><title><![CDATA[Reply to Programatically iterate over public Files in Android on Fri, 24 Jul 2026 05:35:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/beku2">@<bdi>beku2</bdi></a> On C++ side you can use <a href="https://doc.qt.io/qt-6/qdiriterator.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-6/qdiriterator.html</a> to iterate over files/folders.</p>
]]></description><link>https://forum.qt.io/post/839349</link><guid isPermaLink="true">https://forum.qt.io/post/839349</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Fri, 24 Jul 2026 05:35:46 GMT</pubDate></item></channel></rss>