创造一个温度检测Android应用程序,运行在激活后的背景 [英] Creating a temperature-sensing Android app that runs in the background after activation

查看:131
本文介绍了创造一个温度检测Android应用程序,运行在激活后的背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Android应用程序,将跟踪手机的电池的温度。当电池的温度超过某个一定值时,另一个活动随后将给出一个警报是警报。

I am developing an Android application that will keep track of the temperature of the battery of the phone. When the temperature of the battery exceeds some certain value, another activity will then give an alert which is an alarm.

我怎样才能让我的应用程序保持电池的温度跟踪和发送信息到另一个活动(警报系统)来比较值,并确定是否触发警报?

How can I let my application keep track of the temperature of the battery and send that info to another activity (an alarm system) to compare values and determine whether to set off the alarm?

我使用的Eclipse和Android 4.1.2。

I am using Eclipse and Android 4.1.2.

推荐答案

有一个传感器。对于Android的:

There's a sensor. For Android:

http://developer.android.com/reference/android/os/BatteryManager.html#EXTRA_TEMPERATURE

另外有关:<一href="http://stackoverflow.com/questions/7713415/android-hardware-battery-temperature-where-is-the-sensor">Android硬件电池温度,这里是传感器?

这篇关于创造一个温度检测Android应用程序,运行在激活后的背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆