4

I am trying to build an apk using buildozer using pygame. Although buildozer is mainly used for kivy apps but think it should work using pygame also. But my apk created does not run on phone.

So are there some dependencies required to use pygame? Or should I use pygame_sdl2 (is pygame not for Android?) Or should I use pygame along with kivy? If that is the case, how can I do that?

halfer
  • 19,824
  • 17
  • 99
  • 186
Bully Maguire
  • 211
  • 3
  • 15
  • Not sure how good it is, but I've just found a recent tutorial on YouTube: https://www.youtube.com/watch?v=XQTIllli6js – Vito Gentile Aug 24 '21 at 06:47

1 Answers1

1

Buildozer/python-for-android do not support pygame. Even when we maintained the pygame bootstap, it probably didn't work well for normal pygame apps - rather it was a modified version used only as a Window backend for Kivy.

pygame_sdl2 should work, but python-for-android doesn't currently have a build recipe for it. It should be pretty easy to add one if you want to look into it.

inclement
  • 29,124
  • 4
  • 48
  • 60
  • (thanks for the answer). You mean that pygame_sdl2 when used alone should work with buildozer,right. Are there any dependencies required for this? – Bully Maguire Mar 03 '19 at 01:42
  • I am getting error in my pygame_sdl2 install : python setup.py install gives error : sdl2-config not found .Can you please help me? @inclement – Bully Maguire Mar 03 '19 at 12:29
  • pygame_sdl2 will need a build recipe added to python-for-android before it can be used – inclement Mar 03 '19 at 12:54
  • I built an apk using pygame_sdl2 using buildozer but it crashes on phone. What could be the reason for this?Is it because I have to choose screen_sizeaccording to my phone?@inclement – Bully Maguire Mar 05 '19 at 11:27