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 726 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.
      • poVoqP Offline
        poVoq
        last edited by poVoq

        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
        • CiberSheepC Offline
          CiberSheep
          last edited by

          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
          • poVoqP Offline
            poVoq
            last edited by

            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)

            AppLeeA 1 Reply Last reply Reply Quote 0
            • AppLeeA Offline
              AppLee @poVoq
              last edited by

              @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
              • poVoqP Offline
                poVoq
                last edited by

                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
                • poVoqP Offline
                  poVoq
                  last edited by

                  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
                  • poVoqP Offline
                    poVoq
                    last edited by

                    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)

                    AppLeeA 1 Reply Last reply Reply Quote 0
                    • AppLeeA Offline
                      AppLee @poVoq
                      last edited by

                      @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
                      • First post
                        Last post