Regarding get a data from Android default Contacts provider
-
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
-
You could try get it using JNI in C++ code.
-
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.
-
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++. -
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.
-
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] -
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-androidCheers, Chris