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

    Kivy python cross-platform app framework?

    Scheduled Pinned Locked Moved App Development
    10 Posts 4 Posters 2.2k Views 2 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

      Seems like the Kivy framework should be relatively easy to get working on UT, as it can be made to work with SDL2 it seems, or in the hopefully near future also with Wayland. It seems to work well on Android, iOS and Desktop and there was a previous attempt to get it working:
      https://github.com/kivy/kivy/wiki/Ubuntu-Touch

      https://kivy.org/

      Way above my skills to get it working, but there is a nice XMPP client for it, which I would try to port once this framework is supported 🙂

      Any one interested?

      Fairphone 5 (Not yet installed UT on it though)

      1 Reply Last reply Reply Quote 1
      • B Offline
        BobaLava
        last edited by

        I'm fairly new and looking into Ubuntu Touch app development, but I don't really understand why Kivy apps wouldn't run on Ubuntu Touch if they were developed to run in Ubuntu? What exactly is the disconnect here?

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

          Regular Ubuntu uses X11 and GNOME3, Ubuntu Touch uses neither.

          Fairphone 5 (Not yet installed UT on it though)

          1 Reply Last reply Reply Quote 0
          • A Offline
            abmyii
            last edited by abmyii

            Did some testing today:

            photo5769342123638895589.jpg

            photo5769342123638895585.jpg

            photo5769342123638895588.jpg

            photo5769342123638895590.jpg
            (https://github.com/tito/2048)

            photo5769342123638895597.jpg photo5769342123638895596.jpg photo5769342123638895595.jpg

            (https://github.com/kivy-garden/mapview)

            Porting Kivy exposes some interesting potential, and it works for the most part out of the box - though some glitches will need to be fixed before it's stable.

            1 Reply Last reply Reply Quote 3
            • poVoqP Offline
              poVoq
              last edited by

              That looks very promising. I take it that GPU acceleration works already?

              Do you have a repository somewhere online?

              Fairphone 5 (Not yet installed UT on it though)

              A 1 Reply Last reply Reply Quote 1
              • A Offline
                abmyii @poVoq
                last edited by abmyii

                @poVoq Yup, it runs on Mir. No repo yet - I'm just testing things for now. To test, I made / writable and then installed kivy from this ppa https://launchpad.net/~kivy-team/+archive/ubuntu/kivy?field.series_filter=xenial like so (SDL2 is also required, but should be installed automatically - not certain though as I had it preinstalled):

                apt-get install kivy python3-pil
                

                And then to run:

                DESKTOP_FILE_HINT=unity8.desktop python3 <file.py>
                

                It gives a Segmentation Fault sometimes, but rerunning usually fixes it.

                J 1 Reply Last reply Reply Quote 0
                • poVoqP Offline
                  poVoq
                  last edited by poVoq

                  Hmm, if it works from the default Xenial repos it should also be possible to include it as a prerequisite in a clickable with python preset and subsequently a regular click package I think.

                  Edit1: ah, wait it's a PPA. Sorry was too quick to reply.

                  Edit2: No actually Clickable seems to support PPA as well, I guess? https://clickable-ut.dev/en/latest/clickable-json.html#dependencies-ppa

                  Fairphone 5 (Not yet installed UT on it though)

                  A 1 Reply Last reply Reply Quote 1
                  • A Offline
                    abmyii @poVoq
                    last edited by

                    @poVoq Yup, that should work fine.

                    1 Reply Last reply Reply Quote 0
                    • J Offline
                      jhayar0719 @abmyii
                      last edited by

                      @abmyii

                      using this command doesn't work ,

                      [CRITICAL ] [App ] Unable to get a Window, abort.
                      Exception ignored in: 'kivy.properties.dpi2px'
                      Traceback (most recent call last):
                      File "/usr/lib/python3/dist-packages/kivy/utils.py", line 360, in get
                      retval = self.func(inst)
                      File "/usr/lib/python3/dist-packages/kivy/metrics.py", line 169, in dpi
                      EventLoop.ensure_window()
                      File "/usr/lib/python3/dist-packages/kivy/base.py", line 126, in ensure_window
                      sys.exit(1)
                      SystemExit: 1
                      [CRITICAL ] [App ] Unable to get a Window, abort.

                      btw, any news with Kivy ?

                      A 1 Reply Last reply Reply Quote 0
                      • A Offline
                        abmyii @jhayar0719
                        last edited by

                        @jhayar0719 Which command are you running? It appears that SDL2 isn't being detected / used, and thus no window is being created.

                        Also, do you happen to be using focal? I'm not sure if there are additional steps required for that.

                        1 Reply Last reply Reply Quote 0

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • First post
                          Last post