On Oreo the barometric pressure fails

oti
Joined: February 21st, 2015, 3:57 am

June 2nd, 2018, 1:17 pm #1

Hi,

Since my SGS7 runs on Android 8 "sensors.open 6" crashes. "Sensors.open 3" works fine!
Any idea how i can solve this issue?

My google play console report is showing the following problems:

java.lang.ArrayIndexOutOfBoundsException:
 at com.rfo.kVario.SensorActivity.onSensorChanged (SensorActivity.java:222)
 at android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent (SystemSensorManager.java:964)
 at android.os.MessageQueue.nativePollOnce (Native Method)
 at android.os.MessageQueue.next (MessageQueue.java:325)
 at android.os.Looper.loop (Looper.java:142)
 at android.app.ActivityThread.main (ActivityThread.java:6944)
 at java.lang.reflect.Method.invoke (Native Method)
 at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
 at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)

Thx!
Screenshot_20180602-213255_Chrome.jpg
Screenshot_20180602-213255_Chrome.jpg
Quote
Like
Share

Joined: July 10th, 2013, 9:11 am

June 3rd, 2018, 1:52 pm #2

Hi Oti

Thank you for the detailed report.

What happens?

Android Developers sensor web page:
Pro Tip:
Always use the length of the values array while performing operations on it. In earlier
versions, this used to be always 3 which has changed now.



Thus you can do nothing exept waiting a little until I have a result.
I will extent the Sensors.read command with an optional array, which returns an array with length from 1 (or 3?)  to 15 items.

Stay tuned, so I can send you a link for the next OliBasic preview per PM.

Gregor
Quote
Like
Share

oti
Joined: February 21st, 2015, 3:57 am

June 3rd, 2018, 2:22 pm #3

Thx 4 ya response!
Be aware for that the problem even is when sensors.open is called...
Quote
Like
Share