-
Notifications
You must be signed in to change notification settings - Fork 0
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
Unallowed type error when calling get_light() #11
Comments
This is interesting --- no other device we tested returned a What device was this, and what Android version does it run? |
Google pixel. Android 7.1.2
…On Aug 7, 2017 5:57 AM, "aaaaalbert" ***@***.***> wrote:
This is interesting --- no other device we tested returned a float for
the light sensor yet, see our devices/sensors list
<https://github.com/aaaaalbert/sensibility-testbed/wiki>.
What device was this, and what Android version does it run?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANMxlcgxz9-u38wzLNzAga9vkCLd773Jks5sVvu6gaJpZM4Osn_G>
.
|
Thanks a bunch, perhaps the 7.1.2 API allows for |
This raises a broader question about how to handle situations where the API
changes.
So the options are:
1) Convert all instances of this API call to floats. This makes our API
non-backwards compatible as we make these changes, but makes the code
'write-once, run anywhere' with respect to sensor values. Essentially the
programmer updates the code as our API changes, but then the code works
everywhere.
2) Return the type (int or float) of the light sensor on the device. This
makes our API behave the same on all existing devices, but the programmer
has to check what type is returned and decide what to do. If an experiment
uses both old and new devices, there needs to be checking code for both.
However, old code on old devices will not break when the API is updated.
In Seattle, we always opted for option 1, so this is what the Repy sandbox
follows. @yyzhuang, which of these philosophies should Sensibility follow?
…On Mon, Aug 7, 2017 at 9:13 AM, aaaaalbert ***@***.***> wrote:
Thanks a bunch, perhaps the 7.1.2 API allows for floats now.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA0XD0ZI9H4F6dqgJ5af7qjgs8ToZsVUks5sVw1mgaJpZM4Osn_G>
.
|
Currently Android 7.x has about 11% of the market https://developer.android.com/about/dashboards/index.html If we choose option 1, nearly 90% of devices will be affected. Would there be an intermediate solution? |
Funnily enough, I didn't find a reference in the Android docs for any change in Android 7's light sensor function. @bjboyd02, you can patch your local RepyV2 install's |
It seems that all sensors return an array of |
Looks like it's returning a float
Our interface doesn't say int or float, but looks like it's expecting an int. |
@bjboyd02 discovered an error when he called get_light():
The text was updated successfully, but these errors were encountered: