Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Data Sharing with apps from Qt app on android
Forum Updated to NodeBB v4.3 + New Features

Data Sharing with apps from Qt app on android

Scheduled Pinned Locked Moved Solved Mobile and Embedded
11 Posts 3 Posters 1.4k 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.
  • A Offline
    A Offline
    ahsan737
    wrote on 5 Jul 2021, 04:57 last edited by ahsan737 7 Jun 2021, 04:53
    #1

    Greetings,

    This blog was created for android 6.0, explaining the data sharing with other apps on android, and by then, android has been upgraded to v11.0. I've implemented this code in the Qt android app, and it works quite well till android 8, but on android versions 10 and 11, it doesn't read all the apps installed on the system to share data with. Would you please guide which changes are required to make it work with v11?

    Best Regards,
    Ahsan

    J 1 Reply Last reply 5 Jul 2021, 05:16
    0
    • A ahsan737
      5 Jul 2021, 04:57

      Greetings,

      This blog was created for android 6.0, explaining the data sharing with other apps on android, and by then, android has been upgraded to v11.0. I've implemented this code in the Qt android app, and it works quite well till android 8, but on android versions 10 and 11, it doesn't read all the apps installed on the system to share data with. Would you please guide which changes are required to make it work with v11?

      Best Regards,
      Ahsan

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 5 Jul 2021, 05:16 last edited by
      #2

      @ahsan737 said in Data Sharing with apps from Qt app on android:

      This blog was created for android 6.0

      Which blog do you mean?

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

      A 1 Reply Last reply 5 Jul 2021, 05:18
      0
      • J jsulm
        5 Jul 2021, 05:16

        @ahsan737 said in Data Sharing with apps from Qt app on android:

        This blog was created for android 6.0

        Which blog do you mean?

        A Offline
        A Offline
        ahsan737
        wrote on 5 Jul 2021, 05:18 last edited by ahsan737 7 May 2021, 05:19
        #3

        @jsulm I've added the blog link in the original post.

        for reference: https://www.qt.io/blog/2017/12/01/sharing-files-android-ios-qt-app#comments

        E 1 Reply Last reply 5 Jul 2021, 14:18
        0
        • A ahsan737
          5 Jul 2021, 05:18

          @jsulm I've added the blog link in the original post.

          for reference: https://www.qt.io/blog/2017/12/01/sharing-files-android-ios-qt-app#comments

          E Offline
          E Offline
          ekkescorner
          Qt Champions 2016
          wrote on 5 Jul 2021, 14:18 last edited by
          #4

          @ahsan737 just last week I've updated https://github.com/ekke/ekkesSHAREexample to Qt 5.15
          you should give it a test - I have no problems on Android 9 and 10

          ekke ... Qt Champion 2016 | 2024 ... mobile business apps
          5.15 --> 6.8 https://t1p.de/ekkeChecklist
          QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

          A 1 Reply Last reply 6 Jul 2021, 04:49
          3
          • E ekkescorner
            5 Jul 2021, 14:18

            @ahsan737 just last week I've updated https://github.com/ekke/ekkesSHAREexample to Qt 5.15
            you should give it a test - I have no problems on Android 9 and 10

            A Offline
            A Offline
            ahsan737
            wrote on 6 Jul 2021, 04:49 last edited by
            #5

            @ekkescorner thank you very much. I will give it a try.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              ahsan737
              wrote on 6 Jul 2021, 05:35 last edited by
              #6

              I have tried with updated code.

              I can share the data with some apps, but it cannot read all compatible apps for data sharing such as Wechat, Whatsapp, etc.

              Testing OS: Android 11 (Oneplus 8T)
              Target SDK: API 28 Android 9

              Please check the attached files for reference.
              shareData.jpg DeviceConfig.jpg compileKit.jpg

              E 1 Reply Last reply 6 Jul 2021, 07:04
              0
              • A ahsan737
                6 Jul 2021, 05:35

                I have tried with updated code.

                I can share the data with some apps, but it cannot read all compatible apps for data sharing such as Wechat, Whatsapp, etc.

                Testing OS: Android 11 (Oneplus 8T)
                Target SDK: API 28 Android 9

                Please check the attached files for reference.
                shareData.jpg DeviceConfig.jpg compileKit.jpg

                E Offline
                E Offline
                ekkescorner
                Qt Champions 2016
                wrote on 6 Jul 2021, 07:04 last edited by
                #7

                @ahsan737 my app is only an example how you can implement sharing.
                you have to figure out how the missed apps share their data, which intent-filter you need per ex. - sorry, have not the time to figure this out yet.

                ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                5.15 --> 6.8 https://t1p.de/ekkeChecklist
                QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                A 1 Reply Last reply 6 Jul 2021, 07:16
                0
                • E ekkescorner
                  6 Jul 2021, 07:04

                  @ahsan737 my app is only an example how you can implement sharing.
                  you have to figure out how the missed apps share their data, which intent-filter you need per ex. - sorry, have not the time to figure this out yet.

                  A Offline
                  A Offline
                  ahsan737
                  wrote on 6 Jul 2021, 07:16 last edited by ahsan737 7 Jun 2021, 07:17
                  #8

                  @ekkescorner okay sir, thanks for the kind response.

                  PS: Actually, I do not have much experience with android app development, so I cannot dive deep into the issue.

                  E 1 Reply Last reply 6 Jul 2021, 08:23
                  0
                  • A ahsan737
                    6 Jul 2021, 07:16

                    @ekkescorner okay sir, thanks for the kind response.

                    PS: Actually, I do not have much experience with android app development, so I cannot dive deep into the issue.

                    E Offline
                    E Offline
                    ekkescorner
                    Qt Champions 2016
                    wrote on 6 Jul 2021, 08:23 last edited by
                    #9

                    @ahsan737 for one customer per ex. I had to add

                                <intent-filter>
                                    <action android:name="android.intent.action.SEND_MULTIPLE"></action>
                                    <category android:name="android.intent.category.DEFAULT"></category>
                                    <data android:mimeType="*/*"></data>
                                </intent-filter>
                    

                    ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                    5.15 --> 6.8 https://t1p.de/ekkeChecklist
                    QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                    A 1 Reply Last reply 6 Jul 2021, 09:44
                    1
                    • E ekkescorner
                      6 Jul 2021, 08:23

                      @ahsan737 for one customer per ex. I had to add

                                  <intent-filter>
                                      <action android:name="android.intent.action.SEND_MULTIPLE"></action>
                                      <category android:name="android.intent.category.DEFAULT"></category>
                                      <data android:mimeType="*/*"></data>
                                  </intent-filter>
                      
                      A Offline
                      A Offline
                      ahsan737
                      wrote on 6 Jul 2021, 09:44 last edited by
                      #10

                      @ekkescorner thank you

                      A 1 Reply Last reply 18 May 2023, 09:24
                      0
                      • A ahsan737
                        6 Jul 2021, 09:44

                        @ekkescorner thank you

                        A Offline
                        A Offline
                        ahsan737
                        wrote on 18 May 2023, 09:24 last edited by
                        #11

                        @ahsan737

                        replacing the following line of code
                        return createCustomChooserAndStartActivity(sendIntent, title, requestId, uri);

                        with these lines has worked for me.
                        QtNative.activity().startActivity(Intent.createChooser(sendIntent, null));
                        return true;

                        Thanks to Dorian

                        1 Reply Last reply
                        0
                        • A ahsan737 has marked this topic as solved on 18 May 2023, 09:25

                        • Login

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