4 ms·
Another common one is "strict mode", where you tell Android to notify you (via screen flash or log dump) any time your app makes a potentially blocking call (ne
by martythemaniak 14y ago
Another common one is "strict mode", where you tell Android to notify you (via screen flash or log dump) any time your app makes a potentially blocking call (network, file system) on the UI thread. Very useful as a first optimization.
- ConstantineXVI 14y agoAs 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.