-1

I try to make a simple hello world app for android using python, kivy and buildozer.

my hello.py file is

from kivy.app import App
from kivy.uix.button import Label
class Hello2App(App):
    def build(self):
        return Label()
if __name__=="__main__":
    Hello2App().run()

My hello.kv file

<Label>:
text: 'Hello World!'

I use buildozer in ubuntu to compile apk. Sudo buildozer android debug deploy

do i need to apply looping like we do in pygame and Tkinter to show gui or window

2 Answers2

1

Your Python script must be named main.py. If you check the error that you are getting it would read something like "Unable to find main.py". Just try renaming the file from hello.py to main.py and build again.

Mohamed Ali
  • 21
  • 10
0

I fixed your error by changing main.py:

from kivy.app import App
from kivy.lang import Builder


class Hello2App(App):
    def build(self):
        return Builder.load_file("hello.kv")


if __name__ == "__main__":
    Hello2App().run()

hello.kv:

Label:
    text: 'Hello World!'

Now you just need to type buildozer init and buildozer android debug and you are ready to go.