Home  >  Q&A  >  body text

android - 安卓怎么传感器数据?

小组实验,编写安卓手机程序,自动收集手机传感器信息,例如,wifi、GPS、音量、重力加速度等信息。

这个要怎么学最快呢?我去网上找安卓教程,都是从UI布局,按钮触发事件开始讲的,我不需要UI,只要能采集传感器的数据就行了。

我习惯用C++,遇到java的程序,基本能看懂,看不懂的查资料。

求问我一定需要下一个安卓模拟器还是直接用我的小米手机测试(有一个闲置的手机)?
或者哪里有源代码可以直接研究?
感激不尽。

迷茫迷茫2716 days ago337

reply all(2)I'll reply

  • PHPz

    PHPz2017-04-17 15:19:46

    SensorManager can be used for the sensor part
    Reference:
    http://developer.android.com/reference/android/hardware/SensorManager.html
    http://developer.android.com/guide/ topics/sensors/sensors_overview.html
    WIFI information has WifiManager
    Reference:
    http://developer.android.com/reference/android/net/wifi/WifiManager.html

    Google official documents are available.

    reply
    0
  • 黄舟

    黄舟2017-04-17 15:19:46

    Reference: https://github.com/emotionsense/SensorManager
    Someone has already built the wheel.

    reply
    0
  • Cancelreply