Navigation

    UBports Robot Logo

    UBports Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

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

    App Development
    api app development json
    3
    8
    242
    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.
    • poVoq
      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).

      OnePlus3 (dev)

      1 Reply Last reply Reply Quote 0
      • CiberSheep
        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
        • poVoq
          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?

          OnePlus3 (dev)

          AppLee 1 Reply Last reply Reply Quote 0
          • AppLee
            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
            • poVoq
              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.

              OnePlus3 (dev)

              1 Reply Last reply Reply Quote 0
              • poVoq
                poVoq last edited by

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

                OnePlus3 (dev)

                1 Reply Last reply Reply Quote 0
                • poVoq
                  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/

                  OnePlus3 (dev)

                  AppLee 1 Reply Last reply Reply Quote 0
                  • AppLee
                    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