Kivy app with python-for-android orientation portrait.

174 views
Skip to first unread message

Ray Gallagher

unread,
Feb 22, 2019, 5:09:36 PM2/22/19
to Kivy users support
Ok admittely that subject line isn't proper english.

I've gotten a kivy based apk packaged with python-for-android, but I can't seem to set the orientation to portrait. When I start it on the phone, the splashscreen starts as portrait but then it flips to landscape when the app starts. Config reports the width as 800 and height as 600, but setting them to other values doesn't seem to work. 

I can't tell what I'm missing, perhaps an event I need to listen to. The same code did work with earlier versions of kivy / buildozer, but those build environments are gone now, so I've rebuilt with newer versions of everything. So I'm thinking something changed in the meantime.

Are there specific events I need to listen for on startup?

The test file is attached, and I've built it with the docker image at https://hub.docker.com/r/gomyar/kivy-build

It uses:
Latest version (as of this writing) of Android SDK command line tools : 3.3.1
NDK version: r17c
Android build-tools: r28.0.3
python-for-android: 0.7.0
android platform 2.6
kivy 1.10.1

apk build command:
p4a apk --private . --package=com.testpackage --name "test app" --version 0.1 --bootstrap=sdl2 --requirements=python2,android,kivy --release --sdk-dir /jdk --ndk-dir /ndk/android-ndk-r17c --android-api 26 --ndk-api 21 --dist-name=kivy-build --orientation=portrait

any help much appreciated

Ray
main.py

Ray Gallagher

unread,
Feb 22, 2019, 5:23:54 PM2/22/19
to Kivy users support
Oh, also, the phone I'm testing on is a Samsung Galaxy A5 with Android version 8.0.0

Alexander Taylor

unread,
Feb 22, 2019, 7:21:04 PM2/22/19
to Kivy users support
Try writing `kivy==master` in the requirements, instead of just `kivy`. This was fixed recently. If your python-for-android is up to date, it should be using an appropriate Kivy version, but maybe something isn't quite right there.


On Friday, 22 February 2019 22:09:36 UTC, Ray Gallagher wrote:

Ray Gallagher

unread,
Feb 23, 2019, 3:17:29 AM2/23/19
to Kivy users support
Hey Alexander, thanks for the quick reply - I tried installing python-for-android from source (master) and using kivy==master in the requirements (it appeared to download the master version correctly) but I'm still getting the same result.

I don't know if it makes a difference, but I'm also seeing the screen blank on first start, and only display the "hello world" if the app is minimized and restored or if the screen lock comes on and I unlock it. This might be a different issue though.

what was the nature of the original fix? maybe I can test some other approach?

thanks again,

Ray
Reply all
Reply to author
Forward
0 new messages