July 2018
Intermediate to advanced
462 pages
12h 2m
English
Let's create a very simple application that consists of a single button with the caption Python On Android Device. The Kivy application needs to be made in a separate folder and its main program has to be named main.py.
So, let's create a folder named helloworld. Write the following code and save it with the name main.py in the helloworld folder:
from kivy.app import Appfrom kivy.uix.button import Buttonclass demoAndroidApp(App): def build(self): return Button(text='Python On Android Device')if __name__ in ('__main__', '__android__'): demoAndroidApp().run()
The App class is imported from the kivy library because this class includes the properties required to make a fully featured application. A class is made, named demoAndroidApp ...
Read now
Unlock full access