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. Android Qt widgets and MySQL

Android Qt widgets and MySQL

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 2 Posters 816 Views
  • 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.
  • S Offline
    S Offline
    scarja
    wrote on last edited by
    #1

    Hi,
    I'm new, hence maybe obvious questions. I've been through the whole get started with qt widgets programming and get the general basics. Now I have a SQL server running on my local linux machine, this sql server is already accessed by a PHP website. I would like to access the same database from a mobile app for android created by Qt widgets. Is there a way and can you point me to some documentation to connect to the db directly? Or (maybe best alternative) is there a way to call web APIs and send (maybe using POST methods) JSON data and read JSON responses? In the second case I could easily create some php functions to do what I want to do on the database and respond in JSON. I looked for documentation in the examples but didn't find anything, only stuff on using local device sqlite databases.

    Thanks,
    James

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Your second choice is the good one. Exposing a database to the world to be able to connect to it directly from your phone/tablet is a indeed a bad idea.

      For the json part you have the QJsonXXX classes, for the networking part you have QNetworkAccessManager. Depending on your needs and if my memory serves well, the Qxt library has already classes implementing what you need.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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