Solved How to compile qt mysql driver for android?
-
I want create app for android system which connect with database.
How to compile qt mysql driver for android? -
Hi,
Please search the forum a bit. This question has been asked many times already.
See this wiki entry.
Also note that there might be security implication and that you might want to rather implement a REST interface to talk with your database.
-
Thanks for your anwser
-
Maybe this is not you want.
I be opposed to this network: Android [MySQL client] ---> MySQL Server.
I will use this network: Android [HTTP Client] --->Restful API [Python Server] ---> MySQL Server. Everything will be over HTTP or WebSocket, so mobie apps will just need HTTP Client and WebSocket Client, which has already supportd in Android and IOS. -
Do you mean that i should use REST API?
My app -> PHP script -> MySQL database -
@Pyroxar Very good.
-
I must create php script and connect with server by rest api, like this:
https://askubuntu.com/questions/544842/how-to-get-data-from-rest-api-with-qml-for-ubuntu-touch-app
?
AJAX etc? -
Hi @Pyroxar,
you can easily access REST APIs from your Javascript/QML code with the XmlHttpRequest Element.
V-Play Engine also provides some open-source examples (e.g. Twitter demo, PropertyCross demo) that use http-requests to fetch data from the twitter or property-cross API:
Cheers,
GT -
@GTDev
I wanted use XmlHttpRequest Element.
but i have:
QSslSocket: cannot resolve SSLv2_server_method
on my ubuntu and android app.If i will use V-Play i will nnot have an error?
https://forum.qt.io/topic/78345/qsslsocket-cannot-resolve-sslv2_server_method-ubuntu-and-android -
You are probably missing required SSL libraries to make https:// calls (you can verify this by testing if XMLHttpRequest works with URLs that do not use https).
SSL on linux should work right away if you make sure the SSL libs are installed.
For Android, it is currently needed to manually package the SSL library as described here: http://doc.qt.io/qt-5/opensslsupport.html
With V-Play you can avoid having to build and provide SSL for Android, V-Play has SSL already bundled since version 2.10.0.Cheers,
GT