Me
- Instructor
- Teach IT Courses at John Bryce
- Android / Python / Java
Agenda
- GUI in Python
- Kivy Features
- Programming with Kivy
- Demo
- Kivy Open Issues
Python
class Greetings(object):
def say_hello(self):
print('Hello and welcome to the Kivy Presentation!')
g = Greetings()
g.say_hello()
Cross-Platform
Linux, Mac OS X, Windows, Android, iOS
LGPL3 License
Good for Businesses
GPU Accelerated
Buit over OpenGL ES 2
Hello, Kivy!
from kivy.app import App
from kivy.uix.button import Button
class MyApp(App):
def build(self):
return Button(text='Hello, Kivy!')
if __name__ == '__main__':
MyApp().run()
Hello Kivy (2)
# main.py
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
class MyLayout(BoxLayout):
pass
class MyApp(App):
def build(self):
return MyLayout()
if __name__ == '__main__':
MyApp().run()
# my.kv
<MyLayout>:
Button:
text: 'Left'
Button:
text: 'Right'
Demo
- Pong
- Paint
- Particle Panda
Packaging for Mobile
- Embed Python and dependencies inside the Package
- ⇒ Package size is increased (>6mb on Android)
- Enables accessing the native API
- Build tool cross-compiles the app for the mobile platform
Open Issues
- Mobile Packaging is a WIP, supporting only ARM at the moment
- Mobile App size is rather big (>6mb)
- No GUI Designer (planned for next Google Summer of Code)
Summary
- Kivy is an interesting option for developing GUI
- Cross Platform support direct from the box
- Good for products and prototypes