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

feature / screen size πŸ“± #20

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

Conversation

yschermer
Copy link
Collaborator

@yschermer yschermer commented Jul 28, 2023

Gets screen size in density-independent pixels and portrait mode πŸ“±

Tested on:
βœ… Android 13: S22+ / Fold 4
βœ… Android 12: S10e
βœ… Android 11: emulator
βœ… Android 10: device
βœ… Android 9: device
βœ… Android 8: device
βœ… Android 7: emulator
βœ… Android 6: emulator
βœ… Android 5: emulator

@yschermer yschermer changed the title feature / screen size feature / screen size πŸ“± Jul 28, 2023
Copy link
Collaborator

@ninovanhooff ninovanhooff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Is there a backend ticket so that the value will actually be picked up and processed?

Also, when I was still working on this project, the backend would reject requests that contained unknown keys. Something to keep in mind.

}
portraitDpScreenSize
} catch (e: Throwable) {
Q42StatsLogger.e(TAG, "Could not read screen size. Returning null", e)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error or warning? Warning seems most appropriate.

@@ -111,6 +111,8 @@ versions of Android. If unsupported, the corresponding key is omitted.
| Key | Value | Notes |
|-|-|-|
| `screenOrientation`| portrait, landscape, unknown |
| `screenWidth` | String | Screen width in density-independent pixels. Beware: this value is different when there is a different screen orientation. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all data types are strings, right? But I might remember incorrectly. As documentation, it would be more informative to list how the backend should parse the string. Reading this table does not answer the question of whether it is an int or float

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

Successfully merging this pull request may close these issues.

2 participants