<?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[Can&#x27;t find any photo on real devices]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I try to selected a photo in emulator it works well. But in real device i can't find any photo on my phone.</p>
<pre><code>import QtQuick 2.7
import Ubuntu.Components 1.3
//import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import Qt.labs.settings 1.0
import QtQuick.Window 2.12
import QtQuick.Controls 2.5
import QtQuick.Dialogs 1.2
import Qt.labs.folderlistmodel 2.2

MainView {
    id: root
    objectName: 'mainView'
    applicationName: 'ufile.ufile'
    automaticOrientation: true

    width: units.gu(45)
    height: units.gu(75)

    Column{
        anchors.verticalCenter: parent.verticalCenter
        anchors.horizontalCenter: parent.horizontalCenter

        Row{
            Button {
                id: btn
                text: "Open"
                onClicked: fileDialog.open();
            }
        }

        Image {
            id: setImg
            width: 300
            height: 300
            source: ""
        }

        FileDialog {
            id: fileDialog
            title: "Please choose a file"
            folder: shortcuts.home
            onAccepted: {
                var setFiles = fileDialog.fileUrls
                console.log("You chose: " + fileDialog.fileUrls)
                setImg.source = setFiles[0]
                //Qt.quit()
            }
            onRejected: {
                console.log("Canceled")
                //Qt.quit()
            }
        }
    }
}
</code></pre>
<p dir="auto">Then i try to compile the .click file to Ubuntu Touch device i got this error here:</p>
<pre><code>Errors
------
 - security:policy_groups_safe:ufile:picture_files
	(NEEDS REVIEW) reserved policy group 'picture_files': vetted applications only
 - security:policy_groups_valid:ufile:document_files
	unsupported policy_group 'document_files'
/home/fredy/Desktop/ubuntutouch/ufile/build/all/app/ufile.ufile_1.0.0_all.click: FAIL
non-network local connections being added to access control list
</code></pre>
<p dir="auto">I have (clickable update) to the lastest</p>
<p dir="auto">Thanks for your time <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=eeff4b5fc81" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
<p dir="auto">Best Reagrds<br />
007fred</p>
]]></description><link>https://forums.ubports.com/topic/6975/can-t-find-any-photo-on-real-devices</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 09:00:51 GMT</lastBuildDate><atom:link href="https://forums.ubports.com/topic/6975.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 11 Nov 2021 15:10:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Can&#x27;t find any photo on real devices on Mon, 15 Nov 2021 10:59:20 GMT]]></title><description><![CDATA[<p dir="auto">Hi,<br />
If it helps, I did a sample app (with many comments) to manage import of a file with content hub, see:<br />
<a href="https://gitlab.com/ubuntu-touch-applications/sample-applications/importwithcontenthub" rel="nofollow ugc">https://gitlab.com/ubuntu-touch-applications/sample-applications/importwithcontenthub</a></p>
]]></description><link>https://forums.ubports.com/post/57633</link><guid isPermaLink="true">https://forums.ubports.com/post/57633</guid><dc:creator><![CDATA[Aloys]]></dc:creator><pubDate>Mon, 15 Nov 2021 10:59:20 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t find any photo on real devices on Thu, 12 May 2022 14:29:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/007fred50" aria-label="Profile: 007fred50">@<bdi>007fred50</bdi></a> looks like all my explaining was pointless, because it doesn't work now, <code>picSourceSingle</code> is always <code>undefined</code> no matter what I try. No idea why, maybe it's not supported anymore and the docs weren't updated.</p>
<p dir="auto">If you still need a solution <code>ContentPeerPicker</code> works fine:</p>
<pre><code>ContentPeerPicker {
    anchors { fill: parent }
    visible: parent.visible
    showTitle: false
    contentType: ContentType.All
    handler: ContentHandler.Source

    onPeerSelected: {
        picker.activeTransfer = peer.request()
        picker.activeTransfer.stateChanged.connect(function() {
            if (picker.activeTransfer.state === ContentTransfer.Charged) {
                console.log(picker.activeTransfer.items[0].url)
                picker.activeTransfer = null
            }
        })
    }
}
</code></pre>
<p dir="auto">(example provided under the CC0 license)<br />
You can show it in a dialog when user clicks a button.</p>
]]></description><link>https://forums.ubports.com/post/57624</link><guid isPermaLink="true">https://forums.ubports.com/post/57624</guid><dc:creator><![CDATA[klh]]></dc:creator><pubDate>Thu, 12 May 2022 14:29:49 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t find any photo on real devices on Sat, 13 Nov 2021 17:47:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/007fred50" aria-label="Profile: 007fred50">@<bdi>007fred50</bdi></a> oh, I just checked, the last line has nothing to do with the build process, and the <code>FAIL</code> doesn't stop the build or upload (at least I was able to build with these policies).</p>
<p dir="auto">Here you have a complete example of importing a file using ContentHub in QML: <a href="https://api-docs.ubports.com/sdk/apps/qml/Ubuntu.Content/ContentHub.html#detailed-description" rel="nofollow ugc">https://api-docs.ubports.com/sdk/apps/qml/Ubuntu.Content/ContentHub.html#detailed-description</a></p>
<p dir="auto">Basically you have to create a ContentPeer:</p>
<pre><code>ContentPeer {
    id: picSourceSingle
    contentType: ContentType.Pictures
    handler: ContentHandler.Source
    selectionType: ContentTransfer.Single
}
</code></pre>
<p dir="auto">Have a place to store the transfer:</p>
<pre><code>property var activeTransfer
</code></pre>
<p dir="auto">Then in the click handler start the request:</p>
<pre><code>onClicked: {
    activeTransfer = picSourceSingle.request()
}
</code></pre>
<p dir="auto">And handle the transfer result:</p>
<pre><code>Connections {
    target: root.activeTransfer
    onStateChanged: {
        if (root.activeTransfer.state === ContentTransfer.Charged) {
            setImg.source = root.activeTransfer.items[0].url;
        }
    }
}
</code></pre>
<p dir="auto">I adapted it a bit to your code, hopefully you are able to integrate it completely.</p>
]]></description><link>https://forums.ubports.com/post/57591</link><guid isPermaLink="true">https://forums.ubports.com/post/57591</guid><dc:creator><![CDATA[klh]]></dc:creator><pubDate>Sat, 13 Nov 2021 17:47:16 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t find any photo on real devices on Sat, 13 Nov 2021 16:35:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/klh" aria-label="Profile: klh">@<bdi>klh</bdi></a> hello,</p>
<p dir="auto">Thanks for your time <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=eeff4b5fc81" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
<p dir="auto">Here is my 3 fies.</p>
<p dir="auto">clickable.json:</p>
<pre><code>{
  "clickable_minimum_required": "6.22.0",
  "builder": "pure-qml-cmake",
  "kill": "qmlscene"
}
</code></pre>
<p dir="auto">I found this here (<a href="https://docs.ubports.com/en/latest/appdev/platform/apparmor.html#networking" rel="nofollow ugc">https://docs.ubports.com/en/latest/appdev/platform/apparmor.html#networking</a>)</p>
<p dir="auto">and i set into (.apparmor)</p>
<p dir="auto">.apparmor:</p>
<pre><code>{
    "policy_groups": ["camera", "document_files", "picture_files"],
    "policy_version": 16.04
}
</code></pre>
<p dir="auto">my Main.qml code:</p>
<pre><code>import QtQuick 2.7
import Ubuntu.Components 1.3
//import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import Qt.labs.settings 1.0
import QtQuick.Window 2.12
import QtQuick.Controls 2.5
import QtQuick.Dialogs 1.2
import Qt.labs.folderlistmodel 2.2

MainView {
    id: root
    objectName: 'mainView'
    applicationName: 'ufile.ufile'
    automaticOrientation: true

    width: units.gu(45)
    height: units.gu(75)

    Column{
        anchors.verticalCenter: parent.verticalCenter
        anchors.horizontalCenter: parent.horizontalCenter

        Row{
            Button {
                id: btn
                text: "Open"
                onClicked: fileDialog.open();
            }
        }

        Image {
            id: setImg
            width: 300
            height: 300
            source: "/home/fredy/Pictures/Screenshot from 2021-10-22 11-29-16.png"
        }

        FileDialog {
            id: fileDialog
            title: "Please choose a file"
            folder: shortcuts.home
            onAccepted: {
                var setFiles = fileDialog.fileUrls
                console.log("You chose: " + fileDialog.fileUrls)
                setImg.source = setFiles[0]
                //Qt.quit()
            }
            onRejected: {
                console.log("Canceled")
                //Qt.quit()
            }
        }
    }
}
</code></pre>
<p dir="auto">Best Regards<br />
007fred50</p>
]]></description><link>https://forums.ubports.com/post/57585</link><guid isPermaLink="true">https://forums.ubports.com/post/57585</guid><dc:creator><![CDATA[007fred50]]></dc:creator><pubDate>Sat, 13 Nov 2021 16:35:14 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t find any photo on real devices on Sat, 13 Nov 2021 16:25:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/007fred50" aria-label="Profile: 007fred50">@<bdi>007fred50</bdi></a> You can't browse device files directly because of security rules, you have to request them through the ContentHub.</p>
<p dir="auto">The linked documentation also links to the source code of an app that uses it to select images: <a href="https://gitlab.com/cibersheep/webapp-creator/blob/master/webapp-creator/app/ImportPage.qml#L38" rel="nofollow ugc">https://gitlab.com/cibersheep/webapp-creator/blob/master/webapp-creator/app/ImportPage.qml#L38</a></p>
<p dir="auto">Not sure about the last error, can you post your <code>clickable.json</code> and <code>.apparmor</code> file?</p>
]]></description><link>https://forums.ubports.com/post/57584</link><guid isPermaLink="true">https://forums.ubports.com/post/57584</guid><dc:creator><![CDATA[klh]]></dc:creator><pubDate>Sat, 13 Nov 2021 16:25:04 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t find any photo on real devices on Sat, 13 Nov 2021 15:44:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cibersheep" aria-label="Profile: cibersheep">@<bdi>cibersheep</bdi></a> Hej, I have try the website and did not understand it.</p>
]]></description><link>https://forums.ubports.com/post/57583</link><guid isPermaLink="true">https://forums.ubports.com/post/57583</guid><dc:creator><![CDATA[007fred50]]></dc:creator><pubDate>Sat, 13 Nov 2021 15:44:06 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t find any photo on real devices on Thu, 11 Nov 2021 19:08:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/007fred50" aria-label="Profile: 007fred50">@<bdi>007fred50</bdi></a> files are managed through ContentHub.<br />
You have a quick explanation here: <a href="https://docs.ubports.com/en/latest/appdev/guides/contenthub.html" rel="nofollow ugc">https://docs.ubports.com/en/latest/appdev/guides/contenthub.html</a></p>
]]></description><link>https://forums.ubports.com/post/57513</link><guid isPermaLink="true">https://forums.ubports.com/post/57513</guid><dc:creator><![CDATA[CiberSheep]]></dc:creator><pubDate>Thu, 11 Nov 2021 19:08:02 GMT</pubDate></item></channel></rss>