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.
Display a camera preview with PreviewView
A common use case for any camera app is to display a preview from the camera. So far, this has been quite difficult to get right, mostly due to the complexities that exist around the camera2 API edge cases and varying device behaviors. PreviewView, part of the CameraX Jetpack library, makes displaying a camera preview easier for developers by providing a developer-friendly, consistent, and stable API across a wide range of Android devices.
Read More
I am currently investing a lot of time in learning about Kotlin Coroutines. Therefore, I did some research about the most common use cases for using Coroutines on Android and implemented them in an [open-source example project]. It currently contains 16 common use cases implemented with Coroutines. I think the samples in this project can be helpful for lots of developers.
Lambda usage in Kotlin feels more pervasive than Java because of the functional nature of the Kotlin standard library. Some lambdas are merely syntactic constructs that are eliminated at compile-time through the use of inline functions. The rest materialize into whole classes for use at runtime.
Last year, Nick Butcher and Chris Banes presented “Developing Themes with Style” at Droidcon Berlin. It was a welcome recap for themes and styles, as well as best practices for Android theming.
No fear of using @JvmOverloads to create Android custom views. All you need to do is to provide a default constructor with only first 2 parameters(Context & AttributeSet). Do NOT provide defStyleAttr and its default value at all.
For a long time, phones have had a display that refreshes at 60Hz. Application and game developers could just assume that the refresh rate is 60Hz, frame deadline is 16.6ms, and things would just work. This is no longer the case.
Libraries and useful resources
To help people with disabilities access Android apps, developers of those apps need to consider how their apps will be presented to accessibility services. Some good practices can be checked by automated tools, such as if a View has a contentDescription. Other rules require human judgment, such as whether or not a contentDescription makes sense to all users.
In this episode, we chat with friend of the show Leland Richardson. Leland is a main contributor to Jetpack Compose. But in this episode, we pepper him with questions on how he came to the position he’s in viz. a reputed Software Engineer contributing to probably the most cutting edge library in development for Android.
In this video, we'll be looking at what makes a Reactive Program tick, and I'll show you a few key Reactive patterns you can quickly use in your own projects.
Class of the week
A class that manages passing data between fragments.
Beyond Android
So is your app mostly forms or displaying content? User preference panels? Mortgage applications? Implement it with server-side rendering with a sprinkling of JS to implement widgets the web lacks. If only part of your app requires low-latency interactions, use client-side rendering only there.