How to call intents from Qt app in Android?
-
Hi everybody,
I am developing a Qt app for Android and one of my requirements is to implement the classic "Share through social networks" feature. The object I need to share is a string containing an URL and that's it.
I have been searching around and there are several nice resources like these:
http://stackoverflow.com/questions/30128718/general-share-button-on-android-in-qt-quick
http://blog.lasconic.com/share-on-ios-and-android-using-qml/
http://stackoverflow.com/questions/22672522/qt-qml-android-best-practice-to-send-a-custom-intent-share-urlAs far as I can see, there are several approaches to implement these, at least depending on the year of the article. Any way, I would like to read experiences or recommendations from people who already implemented these kind of features.
Right now is there a standard/official way about how to call intents from Qt? I appreciate any comment about it. Thank you! :)
-
One way is to subclass the
QtActivity
, implement the functionality in Java and use JNI to trigger it.
Another way is to use JNI all the way with no .java files. -
Finally I followed the instructions described here:
http://blog.lasconic.com/share-on-ios-and-android-using-qml/Using part of the code available here:
https://github.com/lasconic/ShareUtils-QMLSo, I could implement the "share" feature quickly and with no issues :)