Relative Content

Tag Archive for async

What are the benefits of Android way of “saving memory” – explicitly passing Context objects everywhere?

Turned out, this question is not easy to formulate for me, but let’s try.
In Android, pretty much any UI object depends on a Context, and has defined lifetime. Android can also destroy and recreate UI objects and even whole application process at any time, and so on. This makes coding asynchronous operations correctly not straightforward. (and sometimes very cumbersome) But I never have seen a real explanation, why it’s done that way? There are other OSes, including mobile OSes (iOS, for example), that don’t do such things. So, what are the wins of Android way (volatile UI objects and Contexts)? Does that allow Android applications to use much less RAM, or maybe there are other benefits?

Converting event-based asynchrony to C#5 async

We currently have an interface for an asynchronous video decoder that runs on its own thread. Basically you feed it some data and it’ll eventually call you back on its thread through some events, like so (not real code):

Converting event-based asynchrony to C#5 async

We currently have an interface for an asynchronous video decoder that runs on its own thread. Basically you feed it some data and it’ll eventually call you back on its thread through some events, like so (not real code):

Converting event-based asynchrony to C#5 async

We currently have an interface for an asynchronous video decoder that runs on its own thread. Basically you feed it some data and it’ll eventually call you back on its thread through some events, like so (not real code):