Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation should be elaborated significantly, working examples should be supplied for Android #552

Closed
lokapal opened this issue Aug 29, 2020 · 2 comments
Labels

Comments

@lokapal
Copy link

lokapal commented Aug 29, 2020

I'm trying to detect screen resolution in Kivy for Android:

from kivy.utils import platform

if platform == 'android':
from jnius import autoclass
DisplayMetrics = autoclass('android.util.DisplayMetrics')
metrics = DisplayMetrics()
Height_of_screen = metrics.heightPixels
Width_of_screen = metrics.widthPixels

print("Height = "+ str(Height_of_screen))
print("Width = " + str(Width_of_screen))

Both height and width = 0 in logcat.txt.

Some examples are concerning class 'android.util.DisplayMetrics', some are concerning class 'org.renpy.android.Hardware' and NO docs/examples about both classes and how to use properties from, e.g. DisplayMetrics.

And the reason of all this hell is damn simple - Kivy doesn't want to transfer display parameters from graphics library to user...

@github-actions
Copy link

👋 We use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please use our support channels to get help with the project.
Let us know if this comment was made in error, and we'll be happy to reopen the issue.

@Julian-O
Copy link
Contributor

(Just a general life tip: avoid ascribing negative motivations to people on the Internet without strong evidence - especially when you want help from developers giving you free tools.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants