我在BackgroundTransferService
文档中注意到了这一段:
This property allows applications to request that background transfers proceed when only a cellular connection is available and when the device is on battery power. This is only a preference setting. It does not guarantee that transfers will take place under these conditions. The default value is None, which indicates that transfers should occur only when a Wi-Fi connection is available and when the device is connected to external power.
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh286419(v=vs.105).aspx
我不是以英语为母语的人,但这是否意味着API会掷出一些骰子来选择上传是否有效,无论我选择了什么首选项,传输可能会暂停或失败?
我想向你们证实,就像第一眼看到的那样,依赖随机性是没有意义的。
发布于 2013-07-13 18:20:34
我同意措辞可能会令人困惑。更改此设置允许在电话未连接到WiFi且未插入电源(这是默认设置)时进行后台转接。最好查看可用的值。
仅当设备使用外部电源并具有Wi-Fi连接时,
None才允许转接。这是默认设置。
AllowCellular允许在设备连接到外部电源并具有Wi-Fi或蜂窝连接时进行传输。
当有Wi-Fi连接并且设备使用电池或外部电源时,AllowBattery允许转接。
AllowCellularAndBattery允许在设备使用电池或外部电源并具有Wi-Fi或蜂窝连接时进行转接。
默认值表示,只有当电话具有WiFi并已插入电源时,才能进行转接。通过更改此值,您可以允许电话不使用WiFi和/或不插入电源。如果连接到WiFi或插入,传输仍会发生。
希望这能有所帮助
https://stackoverflow.com/questions/17632839
复制