
Kivy: Develop multi-touch enabled Python apps - tonteldoos
http://kivy.org/
======
Gabry
I had the chance to use Kivy to build a GUI for my Master's thesis. I was
always on the irc channel and yes the community is small but I always got the
help I needed from the creators as well. It's easy to use once you get the
grasp of it. I used it as a proof of concept but was pretty happy with the
result. That was 9 months ago so I'm not up to date with the latest release
though.

------
philondrejack
I've been writing a desktop application with Kivy for the past few months. It
has pros and cons.

The biggest con I have found is that because it's geared mostly for mobile it
doesn't natively support multiple windows. There are work around to this,
including the way that I solved it here...
[https://medium.com/@PhilipAndrews/the-kivy-frontier-
multiple...](https://medium.com/@PhilipAndrews/the-kivy-frontier-multiple..).

But aside from that it's so easy to get a reasonably good looking application
up and running.

Would I recommend it for cross-platform app development? I can't say with
confidence.

For quick roll-out or prototyping? Yes, definitely.

I really hope this community grows over time. The people working on the
framework have been very responsive when I've had questions.

~~~
andybak
The link above is broken. I'd be interested in reading about that if you can
fix it.

------
andybak
I always keep my eye on the Play Store for any production apps using Kivy. It
used to be the case that they all had a fairly unconventional (game-like) UI
or a fairly clunky one.

Can anyone point me to a Kivy app that shows - if not totally native looking -
at least a fairly standard approach to developing an Android UI?

(on the plus side - Kivy apps always seem smooth and responsive on Android)

EDIT - I found this post from January: [https://kivy.org/planet/2016/01/kivy-
android-app%C2%A0showca...](https://kivy.org/planet/2016/01/kivy-android-
app%C2%A0showcase/) Kognitivo looks interesting.

~~~
inclemnet
I think it's still generally the case that Kivy apps tend to use the default
(clunky) theme or something more custom, but there has recently been some user
activity around alternatives, e.g. a set material design themed widgets
([https://github.com/kivymd/KivyMD](https://github.com/kivymd/KivyMD)). I'm
not sure if any apps using this have been published on the Play store.

We've been discussing how to include more unified themeing capabilities in
Kivy itself, ideally as a big new feature in the upcoming 2.0 release.

Edit: I wrote a post at
[http://inclem.net/2016/01/15/kivy/kivy_android_app_showcase/](http://inclem.net/2016/01/15/kivy/kivy_android_app_showcase/)
about some of the best published Kivy apps including themeing considerations,
although they don't aim for a standard Android UI either. I see in your edit
you've already seen this though.

~~~
vanous
For those seeking screenshots, i have found
[https://kivymd.github.io/](https://kivymd.github.io/)

This definitively looks interesting. I had previously tested kivy and only had
little issues with pyjnius and font sizes as switching between versions. More
modern looks sounds great, might the resurrect that old project.

~~~
mixedCase
Hi, I'm the main developer of KivyMD, very cool to see it pop up here!.

I must warn that it's still in alpha status, although being used to develop
business applications. Any bug reports and PRs are appreciated, and anyone has
any questions, just shoot!

------
eivarv
I do a lot of programming in Python, and found Kivy to be easy to use and
thought it was pretty cool when I tried it out a while ago.

 _However:_ Why would one want to use Kivy for desktop interfaces (as I see
many comments mention), rather than native (e.g. Qt) or at least close to
native UI-frameworks?

I think Kivy looks great for prototyping, experimental interfaces, and such,
but I don't see why I would use it over something that lets me use native
interface widgets.

~~~
Kihashi
I would use it if:

    
    
      * I was making "universal" app for mobile and desktop.
      * The app was intended for a Kiosk computer with touch screen.
      * I was concerned about Qt licensing.

~~~
eivarv
Good points!

I may not have conveyed it properly, but I was mainly concerned with
traditional desktop applications.

Regarding Qt licensing concerns: couldn't you just use PySide instead?

 _Edit:_ Sorry, was mixing up Qt and PyQt. Qt itself is dual-licensed
(commercial/LGPL).

~~~
Kihashi
> Regarding Qt licensing concerns: couldn't you just use PySide instead?

At the moment, PySide is still on Qt4. If that was fine, then that would be a
possibility. PyQt supports Qt5.

------
crishoj
Kivy's multiplatform support is impressive. An application I'm working on at
the moment runs in X on Ubuntu, on Microsoft Windows and on a Raspberry Pi 3.
On the latter Kivy draws the UI using the frame buffer directly, without X.

Kivy does have its quirks and oddities. From the top of my head:

\- Want to set the background color on a widget? Gotta drop into GL-like
drawcalls and add a coloured rectangle below your widget.

\- On the Raspberry Pi, I see a strange behaviour where adding and removing
elements from the widget hierarchy causes widgets to randomly not appear, or
flicker, or old widgets to re-appear — even though the widget hierarchy looks
"clean" on inspection. This problem doesn't occur on Linux using X, or on
Windows, so I suspect the reason lies somewhere in the frame buffer
inplementation.

Edit: Formatting

~~~
creshal
> Kivy's multiplatform support is impressive. An application I'm working on at
> the moment runs in X on Ubuntu, on Microsoft Windows and on a Raspberry Pi
> 3. On the latter Kivy draws the UI using the frame buffer directly, without
> X.

Isn't that the same as with most other multiplatform toolkits? GTK and Qt both
support framebuffer rendering, IIRC.

~~~
crishoj
Do you have a reference for GTK supporting FB rendering?

The best I could find was this:

> This current DirectFB GTK+ 3.12 port lacks drag and drop, selection support,
> cursor shapes, full-screen support, geometry hints, properties, and many
> other features, but according to the developers maintaining this out-of-tree
> GTK+ code it's "basically usable" for running modern GTK apps on DirectFB.

Source:
[https://www.phoronix.com/scan.php?page=news_item&px=MTc2OTE](https://www.phoronix.com/scan.php?page=news_item&px=MTc2OTE)

------
melle
I've been using Kivy for a few months now. From my experience it's a great
language/platform to develop proof of concepts and prototypes.

Main drawbacks: \- Community size \- It's missing some general styling
capabilities

Because everything is in Python, it's really easy to get started. Give it a
go!

~~~
tonteldoos
Compared with Qt and Tk for Python, where you have to manually code layouts
(unless you use some layout generation tools, but they're all pretty iffy),
how easy is it to design and code a form/screen/input/etc in Kivy?

~~~
melle
I'd say it's really easy to create a form layout using the kv-language (which
is yaml based and hooks into Python classes)

If you want to use somethimg else than the default theme however, you might
need to do some extra work. As someone else commented, there is a material
design theme, haven't used that myself though.

------
asafira
Can anyone comment on specifically how Kivy is better than the other options
available (e.g., QT?). How have other peoples' experiences been?

Some comments say small community, but that seems like it could be a large
drawback honestly. Does that mean, for example, there are few(er) stack
overflow posts about it, and you are likely to run into some painful issues
along the way? How well does it integrate with matplotlib? How easy is it to
tweak its internal widgets to your liking?

~~~
shadowmint
QT is in every way a better choice, except for the license.

Kivy is great, fun to use, but it suffers for the same thing that many python
applications do: package management is a pain, packing is difficult
(especially dependencies with c libraries), applications are slow, there are
no threads (any action locks the UI), the bridge to native code is quite
troublesome (especially on IOS), it uses a custom DSL for UI layout and the
'non native' widgets can be clunky.

Don't get me wrong; it's a fun platform, but really have a good play with it
before you decide to use it for anything serious, especially for mobile
targets.

(QT isn't perfect either; but its a rock solid platform for building real
applications in. Ultimately though, you should really suck it up and write
native UI for each platform and only share underlying application logic; if
you don't you're just going down the road of various different levels of
clunkiness on every platform).

~~~
mixmastamyk
Why do you think packaging is a pain?

It is possible to do things in a background thread, it may not use all cpus,
but it won't block:

[http://stackoverflow.com/questions/37502084/download-file-
wi...](http://stackoverflow.com/questions/37502084/download-file-with-kivy-
app-without-locking-event-loop)

[https://github.com/kivy/kivy/wiki/Working-with-Python-
thread...](https://github.com/kivy/kivy/wiki/Working-with-Python-threads-
inside-a-Kivy-application)

------
vbit
Kivy seems well designed and easy to use - not just for multi-touch but
general cross platform UI apps, and phone apps.

My only concern is that the community seems small and the site a little dated?

~~~
tonteldoos
Possibly, but I've actually been hunting for a cross-platform, easy-to-build
UI kit for Python, and this certainly seems easier than Tk or Qt. So it fits
the bill for general cross-platform use ;-)

~~~
ZanyProgrammer
It seems like about once a year I'll get the craving to build Python desktop
GUIs, and so far I've never been able to get PyQt installed on my Mac.

~~~
eivarv
What trouble have you had with PyQt?

I've never had any issue installing PyQt (or PySide) whatsoever, though I
usually use Conda [1] with the Anaconda Python distribution, rather than the
system default (which you shouldn't use, IIRC) or the official one from
Python.org.

The easiest way to get started is probably with the Miniconda [2] Python
distribution.

I'm not sure if Conda pulls down Qt, though, or if you have to install that
yourself (e.g. via Homebrew).

[1]: [https://github.com/conda/conda](https://github.com/conda/conda) [2]:
[http://conda.pydata.org/miniconda.html](http://conda.pydata.org/miniconda.html)

~~~
ZanyProgrammer
I can't remember off the top of my head alas:(

------
SeanDav
This is not a criticism, but last time I looked at Kivy, the environment
seemed pretty fragmented and documentation/ tutorials far from ideal. i.e.
pretty immature.

How is it looking right now? Can anyone point me to some good docs and
tutorials?

~~~
picibucor
There is a getting started section:
[https://kivy.org/docs/gettingstarted/intro.html](https://kivy.org/docs/gettingstarted/intro.html)

And a documentation: [https://kivy.org/docs/pdf/Kivy-
latest.pdf](https://kivy.org/docs/pdf/Kivy-latest.pdf)

Best practices and advanced graphics are not well documented.

Still, they are pretty useful.

And I learned also from the following crash-course:
[https://www.youtube.com/watch?v=F7UKmK9eQLY&list=PLdNh1e1kmi...](https://www.youtube.com/watch?v=F7UKmK9eQLY&list=PLdNh1e1kmiPP4YApJm8ENK2yMlwF1_edq)

------
tekromancr
It's interesting that this showed up here today. I just installed qpython on
my phone yesterday so that I could play with Python while I am on the subway.
It has the Kivy libs built in. The only down side is that I haven't figured
out a good way to get the docs available offline so I can refer to them on my
phone as well.

You might think that coding on a phone is super painful, but it is
surprisingly fun when there is nothing else to do.

------
loc_00000000
Too bad they're using python instead of a competent language

~~~
collyw
What do you see as incompetent in Python?

