[Android-development] Using Qt libs in native android app
Harri Pasanen
harri at mpaja.com
Tue Nov 3 08:02:29 CET 2015
Hi,
As you have discovered, it depends on the type of classes you are trying to use.
I have plans to do something similar, but have not started.
My guesses are:
I assume containers Strings and such would work. Anything requiring an event loop might not work, this may include networking?
I was also hoping that QtCore would “just work”, but I was surprised that QStandardPaths is even part of QtCore, as that is obviously platform dependent.
Please post your experiences,
Harri
> On 02 Nov 2015, at 22:28, Shrikant Dhumal <teck.shri at gmail.com> wrote:
>
> Hello there,
>
> I have an unusual situation in terms of how one uses Qt API.
>
> I have a native Android App (implemented using Android SDK) and I am replacing its business logic using Qt API. I do not want to change my UI that is written using native Android Java classes.
>
> I plan to use some of the Qt backend classes (that is a requirement) so, I intend to use only QtCore (no UI or other Qt module).
>
> One of the backend class I intend to use is, QStandardPaths.
> When I call following API's I get empty strings QStandardPaths::standardLocations(QStandardPaths::AppLocalDataLocation);
> QStandardPaths::standardLocations(QStandardPaths::AppDataLocation);
>
> QStandardPaths::standardLocations(QStandardPaths::AppConfigLocation);
>
>
>
> However, when I tried same API in Qt Android examples, I am getting non-null paths.
>
>
>
> When I looked into the code of QStandardPaths for Android to understand the implementation, I realized that the QStandardPaths relies on presence of Qt activity class that is part of QPA (on Android). Is my understanding correct?
>
> Note: getExternalFilesDir() method uses "QtAndroidPrivate::activity()" and "applicationContext()" to determine the paths.
>
>
>
> Is there a means to successfully use Qt backend classes in a native Android App?
>
>
>
> - Shrikant D
>
> _______________________________________________
> Android-development mailing list
> Android-development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/android-development
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/android-development/attachments/20151103/6af1a7be/attachment.html>
More information about the Android-development
mailing list