Android的奇怪的跨设备的行为 [英] Android strange cross device behaviour

查看:149
本文介绍了Android的奇怪的跨设备的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有三个Android设备,三星Galaxy Note的10的的HTC Desire C和索尼的Xperia E.除了我有监听这些设备的特定TCP端口上的服务。而WIFI策略设置为永远在线的所有我的设备,以及我的服务获得一个WIFI_MODE_FULL和PARTIAL_WAKE_LOCK所以CPU和WIFI总是在那里。之后,当我想连接到这些设备从服务器什么不好的事情发生了一段时间。

I have three android devices, a Samsung Galaxy Note 10 an HTC Desire C and a Sony Xperia E. As well i have a service that listens on a specific TCP port on these devices. The WIFI policy is set to "Always on" in all of my devices as well my service acquires a WIFI_MODE_FULL and a PARTIAL_WAKE_LOCK so the CPU and WIFI are always there. After some time when i want to connect to these devices from the server something bad happens.

  • 三星Galaxy Note的设备始终行为正确。
  • 宏达欲望变得无法访问
  • 索尼设备也可达

余Ping探测这些设备,看它们是否有或没有。其结果是:

I Pinged these devices to see if they are there or not. The results is:

  • 在三星的设备总是响应立即正常ping请求。
  • HTC和索尼的设备都无法访问了一段时间,有时他们的反应,但与即使在他们的屏幕上是一个很长的潜伏期(时间平列有时约5000毫秒)。

我知道有与WIFI的政策的一些问题:

I know that there are some issues with the WIFI policy:

  • https://code.google.com/p/android/issues/detail?id=9781
  • https://code.google.com/p/android/issues/detail?id=6611

但是,为什么平的时间是这样的?即使在屏幕上?还有我知道,当屏幕熄灭CPU时钟下降,即使你持有唤醒锁。可以在服务code处理TCP连接 - 这导致问题

But why the ping time is like this?? Even when the screen is on?? As well i know that the CPU clock decreases when screen goes off, even if you hold a wake lock. Can this cause problems in the Service code that handles TCP connections??

推荐答案

制造商希望能够吹嘘具有最长的电池寿命。为此,他们会刮胡子现有的功能,其本身的骨头能兑现其电池寿命。

Manufacturers want to be able to brag about having the longest battery life. To that end, they'll shave existing features to their very bone to deliver on that battery life.

是的,它可能会导致问题,它会造成问题,但是这的原因有很多,你应该编程防守之一。换句话说,请确保您的应用程序是ppared处理丢弃的数据包和可能更长的延迟$ P $。

And yes, it can cause problems and it does cause problems, but that's one of the many reasons you should be programming defensively. In other words, make sure your application is prepared to deal with dropped packets and possible longer delays.

我希望,你的问题并非完全修辞和你真正想要的答案。

Hopefully, your questions weren't entirely rhetorical and you actually wanted an answer.

这篇关于Android的奇怪的跨设备的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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