不可能改变加速度计的速率

不可能改变加速度计的速率

本文介绍了不可能改变加速度计的速率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我必须从我的Andr​​oid手机收集加速度数据,所以我做了一个小程序来做到这一点。

I have to collect accelerometer data from my Android phone, so I have made a little program to do that.

一些测试后,我发现我的Nexus S的加速度计的速度总是每秒50值当手机处于活动状态,以及每秒6值,当它处于休眠状态(以 PARTIAL_WAKE_LOCK ),要什么就给什么(正常 UI 的速度, 游戏最快)。

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

不过,我得到了同样的错误:无论我要求的速度,它始终是每秒50值的时候,手机被激活。

But I got the same "error" : whatever the rate I ask for, it is always 50 values per second when the phone is active.

我不明白为什么我的手机的行为这种方式。这是个问题:

I don't understand why my phone behaves this way. Is it a problem :

  • 有关的Nexus S?
  • 具体到我的电话?
  • 与安卓4.0?

修改:我已经测试了另一种的Nexus S(安卓4.0)的程序,和我有同样的问题。如此看来,以消除上面列出的可能性之一:它不仅关系到我的电话

EDIT : I have tested the program on another Nexus S (Android 4), and I have the same problem.So it seems to eliminate one of the possibilities listed above: it is not related only to my phone.

推荐答案

我已经进行了一些测试不同的智能手机。下面是结果:

I have performed some tests on different smartphones. Here are the results:

Samsung Galaxy Teos
-------------------
* When awake
    Normal: 4.17 Hz
    UI: 8.43 hz
    Game: 16.93 Hz
    Fastest: 109.42 Hz

* When asleep
    The phone sends null values (0), whatever the mode I chose


Samsung Nexus S
---------------
* When awake
    Normal: 49.51 Hz
    UI: 49.51 hz
    Game: 49.51 Hz
    Fastest: 49.51 Hz

* When asleep
    6.06 Hz, whatever the mode I chose

LG Nexus 5
----------
* When awake
    Normal: 15.39 Hz
    UI: 15.4 Hz
    Game: 50.05 Hz
    Fastest: 196.74 Hz

* When asleep
    Normal: 4.96 Hz
    UI: 15.41 Hz
    Game: 50.12 Hz
    Fastest: 198.53 Hz

LG Nexus 4
----------
* When awake
    Normal: 15.75 Hz
    UI: 15.74 Hz
    Game: 48.86 Hz
    Fastest: 195.85 Hz

* When asleep
    Normal: 5.5 Hz
    UI: 15.74 Hz
    Game: 49.16 Hz
    Fastest: 196.75 Hz


Samsung Galaxy Nexus
--------------------
* When awake
    Fastest: 125 Hz

* When asleep
    It sends data


Samsung Galaxy Note 2
---------------------
* When awake
    Fastest: 100 Hz

* When asleep
    The phone does not send anything


Samsung Galaxy S3 and S3 Mini
-----------------------------
* When awake
    Fastest: 100 Hz

* When asleep
    Fastest: 100 Hz


HTC Wildfire
------------
* When awake
    Normal: 4 Hz
    UI: 12 hz
    Game: 22.2 Hz
    Fastest: 38.40 Hz

* When asleep
    The phone does not send anything, whatever the mode I chose


HTC Desire
----------
* When awake
    Normal: 4.36 Hz
    UI: 11.9 hz
    Game: 23.3 Hz
    Fastest: 47.27 Hz

* When asleep
    The phone does not send anything, whatever the mode I chose

请注意,这些测试都使用部分唤醒锁被执行。没有它,Nexus S的不提供数据都当它是睡着了。

Note that the tests have been performed using a partial wake lock. Without it, the Nexus S provides no data at all when it is asleep.

也有智能手机的一个有用的列表,其中加速度计发(或没有)兼容的数据睡着的时候:的

There is also a useful list of smartphones which accelerometers send (or not) compatible data when asleep: http://www.saltwebsites.com/2012/android-accelerometers-screen-off

这篇关于不可能改变加速度计的速率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 07:05