Can you obtain physical size of device in kivy?

Yes, you can determine the physical size of screen with kivy - You could simply use this Module:

(from kivy.core.window import Window)

and then determine sizes by writing this:

(Window.size)

Check this code out (this code determines screen physical sizes on a simple label):

⬇️⬇️

from kivy.app import App
from kivy.uix.label import Label
from kivy.core.window import Window

class MyApp(App):

   def build(self):

     window_sizes=Window.size

     return Label(text="screen sizes= "+str(window_sizes))

MyApp().run()

It is possible to obtain the screen sizes, but you'll need to install plyer and before packaging also patch it, so that you could access the info.

Or just use the plain pyjnius and access android.util.DisplayMetrics with autoclass.

Tags:

Python

Kivy