如何能准确秒表是Android操作系统? [英] How accurate can a stopwatch be in Android OS?

查看:194
本文介绍了如何能准确秒表是Android操作系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我需要一个简单而可靠的秒表与 1毫秒精度机器人设备(变压器片)。我没有经验与Android在所有。
搜索后我没有找到关于什么是最大的精确度,我能得到这个特定背景(见下文)的任何细节。也许这里有人可以给我我需要的信息。
作为秒表将被用于时间的反应和诊断1毫秒是我们所需要的精确度。

so I need to make a simple but reliable stopwatch with an 1 ms accuracy for an android device (transformer tablet). I have no experience at all with android. After searching I'm not finding any specifics about what's the maximum accuracy I could get in this specific context(described below). Perhaps some one here can give me the info I need. As the stopwatch is going to be used for time reactions and diagnoses 1 ms is the accuracy we need.

什么秒表应该做的是非常简单的:


  • 显然节目开始在00:00.000,从那里将要采取7的措施。当用户按下一个键或屏幕,程序应记录所用的时间。在第七次节目将保存措施的TXT文件。

我甚至都不需要显示的印章或经过的时间,并刷新显示。
除了操作系统的应用程序,没有其它应用程序要运行。

I don't even need to display the stamp or the elapsed time and refresh the display. except for the OS apps, no other applications are going to be running.

理论上System.nanoTime()或时间戳会做到这一点。但我不知道这是否会给我1毫秒的准确性,我需要。 可他们给我我正在寻找的准确性?一个简要的解释将是有益的。
有没有其他的方法呢?

如果有一个人是一个Android开发者的信息将是非常美联社preciated。

Theoretically System.nanoTime() or timestamp would do it. But I'm not sure if this will give me the 1 ms accuracy that I need. can they give me the accuracy I'm looking for? a brief explanation would be useful. are there another methods? If some one is a android developer the info will be really appreciated .

谢谢,

更新:本书虽然用户南诺​​言之有理关于Android操作系统的限制,从而使1毫秒精度秒表不可能在一个平板电脑只是方案中,朱利安的进一步答复描述的有趣的和相对廉价的解决方案,以实现采用Android ADK(外部硬件)的目标。

UPDATE: Altho the user Nanno made a valid point about the limitations in the Android OS, thus making the 1 ms accuracy stopwatch impossible in a "tablet-only" scenario, Julian's further answer described an interesting and relatively cheap solution to accomplish the goal using Android ADK (external hardware).

推荐答案

A< 1ms的精确安卓秒表解决方案可以作出使用像这样的工作:

a <1ms accurate android stopwatch solution could be made to work using something like this:

http://developer.android.com/guide/topics/usb/ adk.html

挂钩按钮板,并在远程处理器的时机code(AVR,使用Arduino的工具进行编程。很容易嵌入初学者)然后在Android平板电脑和通过USB开放配件开发套件之间进行通信显示平板电脑上的结果。

hook up buttons to the board, and have your timing code in the remote processor (AVR, programmed using arduino tools. very easy for embedded beginners) Then communicate between the android tablet and the open accessory development kit over USB to display the result on the tablet.

当然,如果你希望人们能够只是将其下载到他们的设备遍布从谷歌世界上发挥......但看到你提到的特定设备这个解决方案不是那么有用,也许你只是想这个项目自己?

Of course this solution isn't so useful if you want people to be able to just download it to their devices all over the world from google play... but seeing you mentioned a specific device, maybe you just want to make this project for yourself?

在这种情况下,它是可行的,只是在一个非常迂回的方式

In that case it is doable, just in a very roundabout way.

这篇关于如何能准确秒表是Android操作系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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