Image for post
Image for post
Illustration by Virginia Poltrack.

Constraint Layout is one of the most popular jetpack libraries and we’re happy to share that Constraint Layout 2.0 is out! It has all of the features of Constraint Layout 1.1 that you’re familiar with to build complex layouts quickly, with tooling integrated with Android Studio to preview your XML or even edit your layout.

Constraint Layout 2.0 brings several new features to Constraint Layout. To use it, bump the version in build.gradle.

implementation “androidx.constraintlayout:constraintlayout:2.0.1”

With the release of 2.0 we’ve also created a github repository for Constraint Layout. …


Hero banner decoration
Hero banner decoration

The new One Tap sign-in and sign-up on Android helps you optimize the flow for authenticating users in your app. For many Android apps, user accounts are an important part of the conversion funnel and a common source of user drop-off. Users (and developers alike!) often forget which account they signed in with or what password they used for your service. By optimizing the process, you can improve conversion rates and reduce drop-off.


Android view binding article header
Android view binding article header

New in Android Studio 3.6, view binding gives you the ability to replace findViewById with generated binding objects to simplify code, remove bugs, and avoid all the boilerplate of findViewById.

TL;DR

  • Enable view binding in build.gradle (no libraries dependencies)
  • View binding generates a binding object for every layout in your module (activity_awesome.xmlActivityAwesomeBinding.java)
  • Binding object contains one property for every view with an id in the layout — with the correct type and null-safety
  • Full support for both the Java programming language and Kotlin

Update build.gradle to enable view binding

You don’t need to include any extra libraries to enable view binding. It’s built into…


Image for post
Image for post

If you’re implementing SMS verification using one-time-codes into your app, check out the new SMS User Consent API.

SMS verification is a common way to add a second form of verification to apps. By sending an SMS message containing a one-time-code like “1234” or “481236” to the user’s phone number, they can then enter the code into your app to confirm that they received the SMS message.

From: SMS

Message: Your one-time code is 1234.

But — let’s be honest. No one actually enjoys typing out one-time-codes. It’s tedious and error prone. …


Image for post
Image for post
Illustration by Virginia Poltrack

This is part of a multi-part series about using Coroutines on Android. This post focuses on solving practical problems using coroutines by implementing one shot requests.

Other articles in this series:

Solving real-world problems with coroutines

Part one and two of this series focused on how coroutines can be used to simplify code, provide main-safety on Android, and avoid leaking work. With that background, they look like a great solution to both background processing and a way to simplify callback based code on Android.

So far, we’ve focused on what coroutines are and how to manage them. In this post we’ll look at how to use them to accomplish some…


Image for post
Image for post
Illustration by Virginia Poltrack

This is part of a multi-part series about using Coroutines on Android. This post focuses on starting work and keeping track of work that has been started.

Other articles in this series:

Keeping track of coroutines

In part one, we explored the problems that coroutines are great at solving. As a recap, coroutines are a great solution to two common programming problems:

  1. Long running tasks are tasks that take too long to block the main thread.
  2. Main-safety allows you to ensure that any suspend function can be called from the main thread.

To solve these problems, coroutines build upon regular functions by adding suspend and resume. …


Image for post
Image for post
Illustration by Virginia Poltrack

This is part of a multi-part series about using Coroutines on Android. This post focuses on how coroutines work and what problems they solve.

Other articles in this series:

What problems do coroutines solve?

Kotlin coroutines introduce a new style of concurrency that can be used on Android to simplify async code. While they’re new to Kotlin in 1.3, the concept of coroutines has been around since the dawn of programming languages. The first language to explore using coroutines was Simula in 1967.

In the last few years, coroutines have grown in popularity and are now included in many popular programming languages such as Javascript, C#, Python, Ruby, and Go


Image for post
Image for post
Illustration by Virginia Poltrack

The more Kotlin code we write, the more we love it! Kotlin’s modern language features together with Android KTX made our Android code more concise, clear and pleasant. We (@objcode and @FMuntenescu) started the #31DaysOfKotlin series as a way of sharing some of our favorite Kotlin and Android KTX features and hopefully get more of you to like it as much as we do.

Week 4 looked at more language basics then dove into some ways Android KTX makes your code more concise and readable!

Check out the recaps for weeks 1, 2, and 3:

Day 22: Calling Kotlin from the Java Programming Language

Using Kotlin and Java in…


Constraint Layout simplifies creating complex layouts in Android by making it possible to build most of your UI using the visual editor in Android Studio. It’s often described as a more powerful RelativeLayout. With Constraint Layout you can define complex layouts without building complicated view hierarchies.

Constraint Layout 1.1 was recently released as stable and there’s a lot to love. A complete overhaul of optimization makes most layouts run even faster than before and new features like barriers and groups make real-world designs simple!

Android Gradle

dependencies {
compile 'com.android.support.constraint:constraint-layout:1.1.0'
}

To use the new features in your project add Constraint Layout…


Image for post
Image for post

The more Kotlin code we write, the more we love it! Kotlin’s modern language features together with Android KTX made our Android code more concise, clear and pleasant. We (@objcode and @FMuntenescu) started the #31DaysOfKotlin series as a way of sharing some of our favorite Kotlin and Android KTX features and hopefully get more of you to like it as much as we do.

In the second we we continued to explore Kotlin — going deeper into topics like sealed classes and inline.

Check out the other recaps:

Day 8: Visibility

In Kotlin, everything is public by default! Well, almost. Kotlin has a…

Sean McQuillan

Android Developer Advocate @Google

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store