如何后台数据传输工作? [英] How does background data transfer work?

查看:185
本文介绍了如何后台数据传输工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何理解限制后台数据在Android的设置确实有效的问题。我一直认为这个限制打开,唯一可见的应用程序可以下载数据,但我目前正在开发动摇了这种认识...我的应用程序注册在AlarmService报警启动的背景In​​tentService每5分钟一个应用程序。然后,该服务将下载最新的金融行情。令人惊讶的对我来说,就是无论什么限制后台数据设置,服务是能够下载了WIFI数据(不与蜂窝接口尝试还)。

所以我的问题是,如何限制后台数据在Android的设置真的管用吗?此外,我应该担心它在我的应用程序的情况,并在有根据的Andr​​oid版本(我已经检查了2.3.3三星Galaxy SII)?

该选项的行为的任何差异
解决方案

  

如何在Android的限制背景资料设置真的管用吗?


有关的Andr​​oid 1.x中/ 2.X / 3.X,这是一个选入设置开发者。开发人员应检查是否后台数据是不允许的,而不是做它在后台,如果它是。

有关Android 4.0以上版本,Android的基本阻止你做互联网接入,如果用户对你的应用程序配置文件要求的(例如,您已经超出了分配带宽阈值)。

I have a problem understanding how the 'Restrict background data' setting in Android really works. I always thought that with this restriction turned on, only visible applications could download data, but currently I'm developing an application that has shaken this understanding... My application registers an alarm in AlarmService to start a background IntentService every 5 minutes. This service will then download the latest financial quotes. What is surprising to me, is that no matter what the 'Restrict background data' setting is, the service is able to download the data over WIFI (didn't try with cellular interface yet).

So my question is, how does 'Restrict background data' setting in Android really work? Also should I worry about it in the case of my application and are there any differences in the behaviour of this option depending on the version of Android (I've checked on 2.3.3 Samsung Galaxy SII)?

解决方案

how does 'Restrict background data' setting in Android really work?

For Android 1.x/2.x/3.x, it was an "opt-in" setting for developers. Developers should check to see if background data is disallowed and not do it in the background if it is.

For Android 4.0+, Android basically blocks you from doing Internet access if the user's profile for your app calls for that (e.g., you have exceeded an allotted bandwidth threshold).

这篇关于如何后台数据传输工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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