Pergunta

I noticed this paragraph in the BackgroundTransferService documentation:

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

I'm not a native english speaker, but does that means that the API will roll some dices to choose whether or not an upload will work, whatever are the preferences I chose, and that transfer can pause or fail?

I want to verify with you, as at first sight, it doesn't make sense to rely on randomness.

Foi útil?

Solução

I agree that the wording can be confusing. Changing this setting allows the background transfer to occur if the phone is not connected to WiFi and not plugged in (which is the default). It's best to look at the available values.

None Allow transfers only when the device is using external power and has a Wi-Fi connection. This is the default setting.

AllowCellular Allow transfers when the device is connected to external power and has a Wi-Fi or cellular connection.

AllowBattery Allow transfers when there is a Wi-Fi connection and the device is using battery or external power.

AllowCellularAndBattery Allow transfers when the device is using battery or external power and has a Wi-Fi or cellular connection.

The default value states that transfers can ONLY happen when the phone has WiFi AND plugged in. By changing this value you allow the phone to not have WiFi and/or not plugged in. The transfer will still happen if connected to WiFi or pluggin in.

Hope this helps

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top