Fresh news from Droid zone
Hello, you're reading Infinum Android Sweets, bringing you the latest Android related news straight to your inbox every week.
Callbacks and Kotlin Flows - Roman Elizarov
In programming languages without built-in support for asynchrony there are two patterns that are used to implement it: callbacks and futures (aka promises). In fact, callbacks are the basic primitives and futures in asynchronous programming are backed by callbacks.
Read More
Working with collections is a common task and the Kotlin Standard Library offers many great utility functions. It also offers two ways of working with collections based on how they’re evaluated: eagerly — with Collections, and lazily — with Sequences. Continue reading to find out what’s the difference between the two, which one you should use and when, and what the performance implications of each are.
Recently, I have been working on a new feature of the core New York Times reading app, and I encountered a very challenging issue: whenever the user clicked on an item of a list, a permanent Snackbar would appear. Since the Snackbar should have been anchored to the lower end of the RecyclerView, the last element of the list would always be at least partially covered, and inaccessible.
In this short series we’re going to build an app to view the Mandelbrot set. While this is not necessarily something that is likely to be of direct use to the majority of app developers (except for those that have a desire to develop their own Mandelbrot set viewing apps), there are some techniques that we’ll explore along the way that most certainly will be of relevance to many.
In modern programming, developers strive to write clean and readable code that is intuitive and easy to use. Normally, to achieve this, developers use design patterns and create specific architectural solutions. Code written in such a way is maintainable and readable by experienced developers, but what if you could write code that everybody can understand and reason about?
Extensions to the Kotlin Flow library. 
In this episode, Donn talks about public speaking and how it can help you grow your career. He dives in by telling a story of his first speaking engagement and how he was riddled with fear, insecurity, doubt and anxiety. He then talks about why speaking can help you grow your career and life leaps and bounds. He wraps up with possible things you can speak about when starting out as well as where you can get your break into the speaking circuit.
Class of the week
Confirms an operation with the user via the trusted system VoiceInteractionService. This allows an Activity to complete an unsafe operation that would require the user to touch the screen when voice interaction mode is not enabled. The result of the confirmation will be returned through an asynchronous call to either onConfirmationResult(boolean, android.os.Bundle) or VoiceInteractor.Request.onCancel() - these methods should be overridden to define the application specific behavior.
Beyond Android
Last year we did a blog post on interservice auth. This post is mostly about authenticating consumers to an API. That’s a related but subtly different problem: you can probably impose more requirements on your internal users than your customers. The idea is the same though: you’re trying to differentiate between a legitimate user and an attacker, usually by getting the legitimate user to prove that they know a credential that the attacker doesn’t.