android-sensors

Android accelerometer full range

喜你入骨 提交于 2019-12-01 01:15:09
I am currently working with Android Sensor API and accelerometer data. Though the internal components should support high acceleration (even +-16g), I tried some recent smartphone and found that the maximum range of exposed data is usually +-2g (e.g. Nexus 5) and sometimes +-4g (e.g. Nexus 4). Is there any way to set the full scale of the sensor? (I didn't manage to find a public API for this) Alternatively, is there any flagship smartphone that support higher range from stock? (e.g. +-8g, +-16g). I'm facing the same problem as yours. DISCLAIMER: I just discovered what I'm writing, so I haven

SCREEN_ORIENTATION_LANDSCAPE upside down - Why?

瘦欲@ 提交于 2019-11-30 23:32:16
问题 I am using the following code to set orientation locking per user preference: private void doLock(boolean locked) { if (locked) { int o = getResources().getConfiguration().orientation; if (o == Configuration.ORIENTATION_LANDSCAPE) setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); else if (o == Configuration.ORIENTATION_PORTRAIT) setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } else { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); } } It

Impossibility to change the rate of the accelerometer

女生的网名这么多〃 提交于 2019-11-30 23:21:27
I have to collect accelerometer data from my Android phone, so I have made a little program to do that. After some tests, I have found that my Nexus S accelerometer's rate is always 50 values per second when the phone is active, and 6 values per second when it is asleep (with a PARTIAL_WAKE_LOCK ), whatever the rate I ask for ( NORMAL , UI , GAME or FASTEST ). So I decided to install an application found on the Internet which tests the rate of the accelerometer : http://samoht.fr/tuto/accelerometers-frequency-on-android-with-code But I got the same "error" : whatever the rate I ask for, it is

Android accelerometer max values

早过忘川 提交于 2019-11-30 21:39:48
So I have been searching for about 3 hours and I have not come up with a good answer/solution. My Question is: Why am I getting a max acceleration value of only about 34 m/s^2 or about 3.5 Gs (34/9.81). Is it because hardware restrictions or software restrictions? If it is hardware I know I can't do nothing about it(or at least not easily). If it is software restriction then how can I remove that restriction, is there any way of doing that? Like an API or something? I would appreciate any help, Thanks. Note : I am using a Galaxy S, if that makes a difference. I have also taking a look at this

Android accelerometer full range

雨燕双飞 提交于 2019-11-30 20:33:51
问题 I am currently working with Android Sensor API and accelerometer data. Though the internal components should support high acceleration (even +-16g), I tried some recent smartphone and found that the maximum range of exposed data is usually +-2g (e.g. Nexus 5) and sometimes +-4g (e.g. Nexus 4). Is there any way to set the full scale of the sensor? (I didn't manage to find a public API for this) Alternatively, is there any flagship smartphone that support higher range from stock? (e.g. +-8g, +

Impossibility to change the rate of the accelerometer

霸气de小男生 提交于 2019-11-30 18:56:57
问题 I have to collect accelerometer data from my Android phone, so I have made a little program to do that. After some tests, I have found that my Nexus S accelerometer's rate is always 50 values per second when the phone is active, and 6 values per second when it is asleep (with a PARTIAL_WAKE_LOCK ), whatever the rate I ask for ( NORMAL , UI , GAME or FASTEST ). So I decided to install an application found on the Internet which tests the rate of the accelerometer : http://samoht.fr/tuto

Android accelerometer max values

偶尔善良 提交于 2019-11-30 17:17:28
问题 So I have been searching for about 3 hours and I have not come up with a good answer/solution. My Question is: Why am I getting a max acceleration value of only about 34 m/s^2 or about 3.5 Gs (34/9.81). Is it because hardware restrictions or software restrictions? If it is hardware I know I can't do nothing about it(or at least not easily). If it is software restriction then how can I remove that restriction, is there any way of doing that? Like an API or something? I would appreciate any

Android - how to make RotateAnimation more smooth and “physical”?

霸气de小男生 提交于 2019-11-30 17:07:09
I'm implementing a kind of a "compass arrow" that follows destination depending on physical orientation of the device using magnetic field sensor. Suddenly I faced with a little problem. Obtaining bearing and azimuth is OK, but performing a realistic animation turned into a really hard task. I tried to use different interpolators to make animation more "physical" (i. e. as in real compass, which arrow oscillate after hairpin rotation, accelerate and decelerate during movement etc). Now I'm using interpolator.accelerate_decelerate and everything is quite good until updates start arriving

Magnetic Fields, Rotation Matrix And global coordinates

眉间皱痕 提交于 2019-11-30 17:04:29
I think that i've read all the posts about this subject, but still i cant understand a few things: Q1: To get the magnetic field vector in global coords i need to multiply the inverted rotation matrix and the magnetic field vector, why do i need to invert the rotation matrix? Q2: Lets say that i have a device and i can calculate the azimuth based on the rotation along the Z-axis using getOrientation(...) method. can i use the rotation matrix or some other method to calculate the azimuth to magnetic north regardless to the phone attitude? So if i will rotate the phone the angle between me and

Get device angle by using getOrientation() function

别说谁变了你拦得住时间么 提交于 2019-11-30 13:18:28
问题 I was using Sensor.TYPE_ORIENTATION to determine current angle of device but TYPE_ORIENTATION is deprecated on API version 8 . In SensorManager manual it refers to getOrientation() function in order to use TYPE_ORIENTATION . Here is the manual Here is my old code : public void onSensorChanged(SensorEvent event) { Log.d("debug","Sensor Changed"); if (event.sensor.getType()==Sensor.TYPE_ORIENTATION) { Log.d("debug",Float.toString(event.values[0])); float mAzimuth = event.values[0]; float mPitch