Skip to content
New issue

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

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

Already on GitHub? # to your account

X & Y coordinates are swapped #4

Open
philipck opened this issue Mar 8, 2013 · 4 comments
Open

X & Y coordinates are swapped #4

philipck opened this issue Mar 8, 2013 · 4 comments

Comments

@philipck
Copy link

philipck commented Mar 8, 2013

I noticed an issue when running this app on an Asus tablet that the x and y acceleration parameters were swapped.

Shouldn't rotations about the x-axis be reflected as deltas in the Y?

@ghoelzl
Copy link
Collaborator

ghoelzl commented Mar 10, 2013

Thanks for writing this comment. MINDdroid was optimized for mobile phones - not for tablets. The app works well on tablets with displays with "portrait" layout, e.g. the Nexus 7 or the first Galaxy Tab.

@philipck
Copy link
Author

Hi, thanks for your response. Do you know how the code might be modified to detect portrait vs. landscape? I am learning android development, and would be happy to help make the code tablet-compatible if someone can steer me in the right direction. I got the code to work on my Asus tablet just by switching the x & y in the sensor event, but a more general solution would be great.

@ghoelzl
Copy link
Collaborator

ghoelzl commented Mar 11, 2013

The problem and its solution is excellently documented at http://developer.download.nvidia.com/tegra/docs/tegra_android_accelerometer_v5f.pdf.
Basically you have to find out the rotation of the screen from its "natural" orientation with http://developer.android.com/reference/android/view/Display.html#getRotation().

@philipck
Copy link
Author

Awesome, that's exactly what I was looking for. Thanks! I will try some experiments tonight.

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

No branches or pull requests

2 participants