Communicating with servers.
WHAT THE STANDARD FRAMEWORK PROVIDES
Requests and responses Session configuration Background transfers Authentication challenges Caching
WHAT A SESSION CONFIGURATION CONTROLS
Timeouts Whether cellular data may be used Caching behaviour Whether transfers continue in the background
WHAT BACKGROUND TRANSFERS DO
Continue after the application is suspended or terminated.
WHAT THEY SUIT
Large uploads and downloads.
WHAT TO ALWAYS SET
A timeout.
WHAT TO IMPLEMENT
Retry with increasing delay Cancellation when a screen is dismissed Handling of each failure kind distinctly
WHAT TO NEVER DO
Disable certificate validation.
WHAT THE LOWER-LEVEL FRAMEWORK PROVIDES
Connection-level control, path monitoring, and protocol implementation.
WHAT PATH MONITORING PROVIDES
Notification of connectivity changes, and whether the connection is expensive.
WHY THAT SECOND POINT MATTERS HERE
It allows deferring large transfers when the user is on metered data.
WHAT TO DO WITH IT
Respect it. Users notice unexpected data consumption.