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. Regarding get a data from Android default Contacts provider
Forum Updated to NodeBB v4.3 + New Features

Regarding get a data from Android default Contacts provider

Scheduled Pinned Locked Moved Mobile and Embedded
7 Posts 4 Posters 4.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.
  • C Offline
    C Offline
    center
    wrote on last edited by
    #1

    Hi!

    I have one question about Android development with QT enviroment.

    Can I get Android Contacts data(through the Contacts provider) using QTWidget or QML base auto-generated Android app?

    If not, I had to directly modify auto generated this Android source. But not wants. Because it will huge jobs.

    Thank you

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MontezooM
      wrote on last edited by
      #2

      You could try get it using JNI in C++ code.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        center
        wrote on last edited by
        #3

        Thank you for your answer ManotrezooM.

        One more question about your answer.

        I can make a Contact provider request through JNI interfcae.
        But How can I get or fetch Contacts provider's respone(result).

        I can't imagine how can I fetch data from JNI interface between QT(qml/qtWidget) and JNI.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MontezooM
          wrote on last edited by
          #4

          Hi,
          I'm not strong in Android Java development, but If Qt doesn't provide such functionality you should use jni. If fetching contacts require a lot of logic it will be better to implement it in Java and put it for example into QtActivity.java. And then provide one/several convenient function to invoke from C++.

          1 Reply Last reply
          0
          • raven-worxR Offline
            raven-worxR Offline
            raven-worx
            Moderators
            wrote on last edited by
            #5

            Qt 5.2 comes with QtAndroidExtras module which lets you "call JNI":http://doc-snapshot.qt-project.org/qt5-stable/qandroidjniobject.html#details and also get it's return code.

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            1 Reply Last reply
            0
            • C Offline
              C Offline
              center
              wrote on last edited by
              #6

              Thank you raven-worx! Will review on QT 5.2
              [quote author="raven-worx" date="1382707866"]Qt 5.2 comes with QtAndroidExtras module which lets you "call JNI":http://doc-snapshot.qt-project.org/qt5-stable/qandroidjniobject.html#details and also get it's return code.[/quote]

              1 Reply Last reply
              0
              • F Offline
                F Offline
                feldifux
                wrote on last edited by
                #7

                You can query the android contacts with the V-Play API like this:

                import VPlayApps 1.0
                
                App {
                  AppListView {
                    anchors.fill: parent
                    model: nativeUtils.getContacts()
                
                    delegate: SimpleRow {
                      text: modelData.name
                      detailText: modelData.phoneNumber
                    }
                  }
                }
                

                More info is here:
                https://v-play.net/updates/release-2-13-0-free-rewarded-videos-native-ads-for-google-admob-qt#get-contact-list-ios-android

                Cheers, Chris

                Founder of Felgo SDK - http://felgo.com/qt

                Felgo simplifies

                • Mobile App Dev with Qt esp. iOS & Android
                • Game Development with Qt

                What others say

                Felgo scored #1 in Cross-Platform App Development Tools Report - see why: https://goo.gl/rgp3rq

                1 Reply Last reply
                0

                • Login

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