Android accelerometer issue in beta 11.

Previous topic - Next topic

spacefractal

Quote from: BdR on 2012-Dec-21
I'm testing on Android again, and two things I've noticed

Firstly, my app uses PLATFORMINFO$("DOCUMENTS") to store the settings and saved game. Now I was testing on an Android device without a SD card and then the game was not saved. So, I changed it to PLATFORMINFO$("APPDATA") for Android just to be sure, so like this:
Code (glbasic) Select
CONSTANT SETTINGS_FILE$ = "/snakeslider.ini"
//INIOPEN PLATFORMINFO$("DOCUMENTS") + SETTINGS_FILE$
INIOPEN PLATFORMINFO$("APPDATA") + SETTINGS_FILE$


Second, the GETJOYX(0), GETJOYY(0), GETJOYZ(0) functions don't seem to work for Android. When compiling with v10 for Android, it gave the accelerometer values but now in v11 it seems to give just 0. Only GETJOYZ(0) sometimes jumps from 0 to -1 when I shake the device. The GETJOYNAME$(0) still gives "Android accelerometer" though..

I can as I wrote in the beta 11 thread, confirm this bug.

The java part code works fine. If I multiply with 10 in onSensorChanged() in SDLActicvity.java, then I got returned a nice integer values between -10 and 10. But If I multiply more, then its seen its have limited to 10 for some reasons. so its a bug in the onNativeAccel() c++ function. Its cleary its have been converted to integer, which its should not....

This bug can been workaround by using the java communication code I wrote in the code snippets forum and then gets its floats that way. I look on that later, or by multiply with 10 (which give some control, but not fine control over it).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

caffeinekid

Is there any update on this please? :bed:

Kitty Hello

Yes... And no... I fixed this, but the multitasking is still buggy. So I used the new SDL2.0 port. Which works now. But I need a sdl-mixer lib now. I hope to fix it pretty soon.

BdR

I downloaded GLBasic v11.322 and the GETJOY commands now work correctly again on Android :good: sweet

sf-in-sf

Quote from: spacefractal on 2012-Dec-26

Second, the GETJOYX(0), GETJOYY(0), GETJOYZ(0) functions don't seem to work for Android.
They do work for me and I used them a lot. Android 4.0 archos G9 10.1 tablet,  IDE v. 10.244. I get some strange values -0.917 to +0.917 after calibrating the tablet repeatedly, instead of 1.0
What you describe looks like you assign an int variable to the GETJOY... Fn. Try once:
Code (glbasic) Select
static jx# // float or so.
jx = GETJOYX(0)

On the day the atom is a cube I will start believing in the square pixel.

erico

Quote from: BdR on 2013-Feb-26
I downloaded GLBasic v11.322 and the GETJOY commands now work correctly again on Android :good: sweet

GReat, I was using v10, which it works, and the one v11 before the last one, which it didn´t.
Time to update the beta :)