• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
UBports Robot Logo UBports Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Example of an qt app that accesses a JSON API over http?

Scheduled Pinned Locked Moved App Development
apiapp developmentjson
8 Posts 3 Posters 728 Views 1 Watching
Loading More Posts
  • 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.
    • P Offline
      poVoq
      last edited by poVoq 12 Feb 2019, 01:17 30 Nov 2019, 17:14

      Is there a nice example of an app (that I could fork) that accesses various data from a JSON based API over the web?

      Something like a note writing client or a micro-blogging app?

      I looked around a bit on the open-store and could find anything. Sadly the official Notes app uses the Evernote API which isn't JSON based, otherwise that would be perfect (and my skill level isn't anywhere near rewriting the API access part).

      Fairphone 5 (waiting for port)

      1 Reply Last reply Reply Quote 0
      • C Offline
        CiberSheep
        last edited by 30 Nov 2019, 18:05

        The Weather app is an example:

        https://gitlab.com/ubports/apps/weather-app/tree/master

        Another planet, another time, another universe!

        1 Reply Last reply Reply Quote 2
        • P Offline
          poVoq
          last edited by 30 Nov 2019, 18:55

          Thanks, that looks like a good start already. Is there maybe also an app that doesn't only read data, but also writes it?

          Fairphone 5 (waiting for port)

          A 1 Reply Last reply 30 Nov 2019, 21:55 Reply Quote 0
          • A Offline
            AppLee @poVoq
            last edited by 30 Nov 2019, 21:55

            @poVoq I know mine does.
            I'm sending commands through JSON to a domoticz server
            The IP address is customizable in settings.

            I can guide you through the code if you need help.
            https://gitlab.com/AppsLee/domoticz-ubports

            1 Reply Last reply Reply Quote 1
            • P Offline
              poVoq
              last edited by 30 Nov 2019, 22:08

              Cool, I'll have a look. Still in the early brainstorming/learning phase, but I might get back to you sometimes in the future.

              Fairphone 5 (waiting for port)

              1 Reply Last reply Reply Quote 0
              • P Offline
                poVoq
                last edited by 1 Dec 2019, 10:45

                Am I guessing right that this library would work well with the typical clickable setup:
                https://github.com/qtrest/qtrest

                Fairphone 5 (waiting for port)

                1 Reply Last reply Reply Quote 0
                • P Offline
                  poVoq
                  last edited by 3 Dec 2019, 12:24

                  Found this basic tutorial and though it might be of interest for others:
                  https://retifrav.github.io/blog/2018/06/09/qml-xmlhttprequest/

                  Fairphone 5 (waiting for port)

                  A 1 Reply Last reply 3 Dec 2019, 15:53 Reply Quote 0
                  • A Offline
                    AppLee @poVoq
                    last edited by 3 Dec 2019, 15:53

                    @poVoq Yes this is the easiest way to do it.
                    If you search for the first release of my app this is what I used.

                    But I had a limitation regarding self signed certificates.
                    So I decided to create a C++ library to send HTTPS requests.

                    Thanks for sharing your findings ; could be helpful for other 🙂

                    1 Reply Last reply Reply Quote 1
                    7 out of 8
                    • First post
                      7/8
                      Last post