UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    apparmor picture_files_read

    Scheduled Pinned Locked Moved App Development
    15 Posts 4 Posters 2.3k Views 2 Watching
    Loading More Posts
    • 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.
    • flohackF Offline
      flohack @Craig
      last edited by

      @Craig I dont think that its supported for an App to launch another app. You could export a picture and then the suer canchoose Gallery as a target. But so far just launching a specific app is not possible. Its also hard to make this stable since what if Gallery app is not installed, has been renamed etc ?

      My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

      CraigC 1 Reply Last reply Reply Quote 0
      • AppLeeA Offline
        AppLee @Craig
        last edited by

        @Craig
        Hi, and good job on this.
        Now you want to use the content hub the other way around and export a picture from your app.

        You'll have to add ContentHandler.Source to your SDLTest-contenthub.json
        You should read this : http://docs.ubports.com/en/latest/appdev/guides/contenthub.html#exporting

        As Flo wrote, you cannot force an app, the user has to select the destination app.

        CraigC 1 Reply Last reply Reply Quote 0
        • CraigC Offline
          Craig @flohack
          last edited by

          @Flohack What about when the Messaging app launches the content hub so I can attach an image to a text message?

          AppLeeA 1 Reply Last reply Reply Quote 0
          • AppLeeA Offline
            AppLee @Craig
            last edited by

            @Craig
            What Florian meant is that an app cannot directly opens another one (even less a specific one).
            You have to go through the Content Hub to do so, but it's not the messaging app opening the gallery...

            CraigC 1 Reply Last reply Reply Quote 0
            • CraigC Offline
              Craig @AppLee
              last edited by

              @AppLee Why would I want to export a picture from my app when that's not what it needs to do? It needs to acquire a picture from the content hub, namely Gallery or File Manager. Sorry, maybe I didn't make it clear what I'm trying to do.

              1 Reply Last reply Reply Quote 0
              • CraigC Offline
                Craig @AppLee
                last edited by

                @AppLee Sorry, I must not be using the right vocabulary. Basically, like how the Messaging app opens the content hub and you can choose from Gallery or File Manager, then a photo is sent to a directory where the Messaging app can access it. How can I get my C++ app to open/launch/etc the content hub? I have already added the required code for my app to be listed as a "destination" in the content hub. I just need to understand how to create an event/link/etc in C++ that will open the content hub for my app's users. Thank you!

                AppLeeA 1 Reply Last reply Reply Quote 0
                • AppLeeA Offline
                  AppLee @Craig
                  last edited by

                  @Craig
                  Oh sorry, I ddin't fully understand your question.

                  So you can refer there : http://docs.ubports.com/en/latest/appdev/guides/contenthub.html#importing
                  You can call the ContentPeerPicker in your code to display the app choice to import a Picture from.

                  CraigC 1 Reply Last reply Reply Quote 0
                  • CraigC Offline
                    Craig @AppLee
                    last edited by

                    @AppLee I read that Importing section, thanks. What language is that written in? Qml? My app is written in C++. Is there a way to open the content hub with C++? Or is there some headers I can put in my C++ program that will enable a new function to do that? I can't seem to find documentation for C++.

                    AppLeeA 1 Reply Last reply Reply Quote 0
                    • AppLeeA Offline
                      AppLee @Craig
                      last edited by

                      @Craig
                      Yes it's QML, I don't know about C++ only.
                      Can you consider some QML for the front part of your app ?
                      It's not difficult to learn and use.

                      CraigC 1 Reply Last reply Reply Quote 0
                      • CraigC Offline
                        Craig @AppLee
                        last edited by

                        @AppLee Okay, I tried it. I did "clickable create" and selected the C++ binary option.

                        When I run "clickable" the main.cpp file calls qml/Main.qml and it says "Hello World!" on my touch device.

                        Now, I tried to swap the code in Main.qml for this code here:
                        https://api-docs.ubports.com/sdk/apps/qml/Ubuntu.Content/ContentHub.html
                        The code just below "Example usage for importing content:"

                        When I run "clickable", clickable reports: /bin/sh: 1: Syntax error: "(" unexpected

                        Is there a mistake in the documented code? What do I need to put in the Main.qml file so it brings up the content hub?

                        Thanks!

                        1 Reply Last reply Reply Quote 0

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better πŸ’—

                        Register Login
                        • First post
                          Last post