3 ms·
As of (IIRC) Gingerbread, you get thrown a NetworkOnMainThreadException if you're making network calls in the UI thread and haven't explicitly turned StrictMode
by ConstantineXVI 14y ago
As of (IIRC) Gingerbread, you get thrown a NetworkOnMainThreadException if you're making network calls in the UI thread and haven't explicitly turned StrictMode off.
(The WinRT SDK goes a step further, there simply _aren't_ any blocking network/FS methods available. async/await makes that less painful than it would seem, though.)
- ConstantineXVI 14y agoPS: It's actually Honeycomb and later. This behavior only kicks in if you're compiling against HC+, anything compiled against GB or lower can freely block the UI thread with reckless abandon regardless of which Android version you're running on.