简体   繁体   English

如何在Android中使用外部传感器?

[英]how to work with external sensors in android?

i want to build a app which detect temperature of food people milk room etc, so i want to know that how to detect a external sensor in android, which is connected to its 3.5mm audio jack,like sound read by phone can by applying temperature sensor it can sense temp.please refer me some tutorials or sample.i 've read about open data kit but don't know how to use this please help me. 我想开发一个可检测食物,人奶室等温度的应用程序,因此我想知道如何检测android中连接到其3.5mm音频插孔的外部传感器,例如通过应用温度可以读取电话中的声音可以感应温度的传感器。请向我介绍一些教程或sample.i,我已经阅读了有关开放数据包的信息,但不知道如何使用它,请帮助我。

     mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
            mPressure = mSensorManager.getDefaultSensor(Sensor.TYPE_TEMPERATURE);

is This Works for external sensors too 这是否也适用于外部传感器

I am not sure how much knowledge you have about sensors and how you planned to interact. 我不确定您对传感器有多少知识以及如何计划进行交互。

Maybe you can take a look at Raspberry Pi, its an external board which can interact with sensors, and can run linux or android operating system. 也许您可以看看Raspberry Pi,它是一个可以与传感器交互的外部板,可以运行linux或android操作系统。 It also works using internet so you can communicate between your mobile and the Raspberry Pi. 它还可以使用互联网工作,因此您可以在手机和Raspberry Pi之间进行通信。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM