Kivy python cross-platform app framework?
-
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-TouchWay 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?
-
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?
-
Regular Ubuntu uses X11 and GNOME3, Ubuntu Touch uses neither.
-
Did some testing today:
(https://github.com/tito/2048)(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.
-
That looks very promising. I take it that GPU acceleration works already?
Do you have a repository somewhere online?
-
@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. -
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
-
@poVoq Yup, that should work fine.
-
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 ?
-
@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.