Skip to content

How do i have support all the phones using TYPE_ACCELEROMETER? #22

Open

Description

@fahimsakri-zz

I want to use this library but the gyroscope is not supported by all the phones.. So how can i achieve this using TYPE_ACCELEROMETER?

Activity

  1. nvb commented on Feb 13, 2016

    @nvb
    Owner

    Hi Fahim, that's a really good question. As you may know, Motion uses the Rotation Vector sensor to determine screen orientation, which it bases its parallax effect off of. The Rotation Vector sensor acts as a "virtual" sensor, combining sensor data from a phones accelerometer, geomagnetic sensor, and gyroscope to provide extremely accurate information after performing some calculations called "sensor fusion". It does this by working in quaternion coordinates, which allows the sensor to avoid issues like gimbal lock. Unfortunately, with just one of these sensors and no "sensor fusion", the library would not work very well because the orientation data would have issues. For instance, if we only used the accelerometer, the orientation could only be known relative to some reference orientation, but not absolutely. We would also run into all kinds of issues with users moving their phone, which would throw off sensor data.

    Because of this, I would suggest gating your usage of Motion to only phones that have support for the Rotation Vector sensor. This will allow the majority of users who do have access to the sensor to get the full parallax effect without any hiccups, while those who don't have the sensor don't end up having a bad experience with a janky parallax effect. Right now, Motion is implemented in a way that registerSensorManager will be a no-op if the Rotation Vector sensor is not enabled, which means that you don't need to worry about actively gating the usage of Motion yourself.

  2. fahimsakri-zz commented on Feb 13, 2016

    @fahimsakri-zz
    Author

    @nvanbenschoten thanks for your reply... with type_accelerometer i am able to move the image from one end to other but the issue is my image keeps moving in normal state also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions