2016년 12월 21일 수요일

orientation sensor works on some devices , and doesn't for others


i'm just starting with app inventor , made a small test app that shows device orientation angle .
when i connect via wifi using samsung galaxy S5 all works ok , orientation sensor updates pretty fast .
when i connect LG G2 via wifi nothing works 
when i download apk to LG G2 still not working .
when i download apk to LG G3 it works , orientation sensor updates pretty slow compared to galaxy S5 .
when i download apk to lenovo tablet , again , not working .

is app inventor works only with specific IMU models ? 
image of the blocks added.  (one of the variables was used to "reset the angle" , i deleted this part from block to make it simpler)

 apk.jpg

--
try the compass example and let us know, if it works for oyu
How to build a simple compass app with App Inventor


➠ compass.aia


-- 
tried the compass app
works on galaxy s5 .
downloaded apk to lg g2 - not working . only shows the image , nothing moves .
android ver. on lg is 4.4.2 , is it too old ?

-- 
Did you try another compass app the phone that did not work?
There could be some reasons for it not working:
- the phone does not have an orientation sensor
- the sensor is not initialized, or enabled

Long ago I read of problems with it on some phones, but I forgot what it was exactly. You can try to google yourself.

--
i checked with accelerometer sensor - same . works on galaxy but not on lg .
i wrote simple code to see if sensor enabled , and it is or both devices .
how can i initialize orientation or accelerometer sensors?
found nothing googling

-- 

You did not tell me yet whether you tried to download a simple compass from the Playstore and see if that works on both phones.

-- 

-- 
sorry , it looks like the issue fixed . i downloaded sensor kinetics app from the app store . at first it didnt show data from the accelerometer and orientation .then i chose different settings in this app , like "rate :normal" or "rate:fastest" and it started to work .
now my app works also .
i restarted the phone and the app continues to work , without opening the sensor kinetics app .
strange .
maybe the sensor need some kind of initialization .

--
That would have been my next recommendation: restart your phone.
I am happy it worked!

--


댓글 없음:

댓글 쓰기