Time for some bio updates...
I'm excited to announce that I'm no longer a GDE, as this is my first week as an Android Developer Relations Engineer at Google! 🎉
Really looking forward to contributing to
@AndroidDev
, focusing on Kotlin.
Career update - yesterday was my last day as a Googler (to be clear: by choice). It's been great working in the MAD team in Android DevRel, with all the wonderful people there, but now it's time for a change.
Before that though... a month+ of funemployment!
Check out our new coroutine testing guide, hot off the press! 🧵🧪
In this guide, you'll learn how to use the testing APIs new in kotlinx.coroutines.test 1.6, as well as the best practices you'll need to test your Android code!
Been so busy lately that I haven't even done a proper bio update yet...
Happy to share that as of this week I am a Developer Advocate at
@jetbrains
! Super excited to continue working on making Kotlin awesome.
I've heard a few complaints about range syntax being hard to remember in Kotlin.
While I never felt that it was confusing (and rarely use ranges in my code), you can now be relieved: there are now inlay hints to help with range bounds!
You can try it in Android Studio Dolphin.
Are you using the OnLifecycleEvent annotation to hook into lifecycle events? This is now deprecated; use DefaultLifecycleObserver instead, simply overriding its appropriate methods.
The best part? You can remove the lifecycle-compiler annotation processor from your project! 🥳
Retrofit is finally receiving the proper coroutine support it deserves! Read more about it in my latest blog post here:
#AndroidDev
#Kotlin
#Coroutines
itshappening.gif
Dagger's latest release is the first one with KSP support for both Dagger and Hilt!! 🎉
This is a good time to completely get rid of KAPT...
Wrote a bit about representing view state as a single object. Learn how to design your state classes, and how to actually use them in practice - lots of small tips in this one!
#AndroidDev
#Kotlin
Designing and Working with Single View States on Android
The media playback UI on Android is in a really good place now. It looks great, and it also contains lots of useful info and controls, even more than I'd expect it to have.
We finally shipped this small improvement that I've been lobbying for: the Compose / Kotlin compatibility error message now includes the link to the compatibility map in the Android docs!
Android development is officially Kotlin-first, and you should use Kotlin for Android development.
Just putting that out there, as this still comes up as a question every week somehow.
See this page for details about Android's commitment to Kotlin:
I'm looking for my next job. Some params:
👨💻 Should use my Android/Kotlin expertise
📱 Product work preferred, SDK/tooling/enablement also cool
📚 Happy to do lots of knowledge sharing and mentoring
🇭🇺 Budapest based, happy to remote
Please share / DM me if you got something 🙏
With
@androidstudio
Giraffe finally out, I can now share some small things I've added to this release!
1. For processors included with kapt that also work with KSP, you now get prompted to migrate to KSP (with a quick fix if KSP is already in the module)
Spent 30 minutes trying to figure out why a RecyclerView wasn't displaying items that I've put into its adapter. Checked everything. Debugged inside the adapter, checked that the View has width and height, a LayoutManager...
I just never called setAdapter on the RecyclerView.
Did you know you can right-click a
#JetpackCompose
Preview to copy it as an image?
Pretty useful for grabbing a quick screenshot to share instead of trying to clip it neatly with the OS-provided tools.
Today I learned that Kotlin's groupBy function can take an additional parameter which is used to transform each value of the original List before it gets placed in the newly created Map.
Really neat!
So it turns out that having a const value inside a private companion object will end up generating a public field that's accessible from Java. So it's worth making these values doubly-private!
What an excellent feature in
@androidstudio
to find and import a dependency based on what I'm trying to use - makes getting started in a new project way simpler!
Earlier today, I gave the first lecture for our university subject that teaches the
@kotlin
language (without Android!), where about 100 students showed up.
Does anyone know if there's another university where the language is being taught?
Kotlin 1.5 will bring exciting new features, among them improvements to sealed classes and an introduction of sealed interfaces. Let's take a look at what that will look like!
Sealed goodies coming in Kotlin 1.5
#Kotlin
#AndroidDev
#GDE
🗞️ KSP news 🗞️
We now have a page that helps you migrate from using kapt to KSP:
In Giraffe canary 7, you'll also find a new Lint warning that assists you in migrating where possible.
Check these out and please send any feedback about it my way!
New
#AndroidDev
blog post!
In this one, I take a look at a WIP implementation of an Android concept app which was trending very high on reddit last week.
Jetpack, Kotlin, and more inside - take a look!
Let's Review: Pokedex
Do you use Retrofit and kotlinx.serialization?
Good news: the kotlinx converter has been upstreamed and is now a proper Retrofit artifact:
There's also a BOM now and other goodies.
So,
@_aurimas
has done it first, but I was also already working on it too 😃
Here's a neat Compose Clock, as the very first steps of my
#JetpackCompose
learning experience. Hope you learn something from it too!
Compose O'Clock
#AndroidDev
#GDE
I know we're a bit late for the actual anniversary, but it's time to celebrate 5 years of official Kotlin on Android! 🎉🥳
It took a lot of work to make this possible, and there's plenty more work on Kotlin ongoing today. Read the full story:
I've been building some
#JetpackCompose
things this week and noticing that some code changes like dp amounts or text changes are applying on my device live as I'm making them, no rebuild or re-run required.
Is this a new feature? Is it described somewhere?
Quick career update: my involuntary job search that started back in the summer is over.
As of last month, I am working on making the
@getstream_io
Android SDK an amazing experience for devs to integrate 😃
@github_skydoves
Ah yeah, that's a bad one 😄. Luckily you can fix this yourself in Studio by excluding it from completion (IDE or project-wide, the latter writes it into the .idea folder so you can check it into git!).
The one that always got me was the non-Compose Color class.
With so many things cancelled this week, it only makes sense to publish this now... Here's an article on the basics of coroutine cancellation that you should know about.
🧵❌ Coroutine Cancellation 101 🧵❌
Speaking of importing Modifier...
If you're autocompleting a Modifier parameter in Studio, you can just type the name of a modifier, without first typing out "Modifier." - it will add that for you & import it if needed!
I was wondering: "Which apps on my phone use Ktor?"
So I picked up the stackzy project from
@theapache64
, hacked three new screens into it, and it can now decompile all apps over ADB to analyze their contents together. It's not quick, and the code is awful, but it works great!
I kept running into discussions of different Fragment lifecycles, and especially how you can work with them in Jetpack. So here's a detailed, illustrated rundown:
Fragment Lifecycles in the Age of Jetpack
In other very specific API news: I like how extensive the Kotlin stdlib is, but maybe, just maybe firstNotNullOfOrNull is where it went too far 😃
Really though, say it five times quick
I've been writing a lot about architecture lately, and today I'm finally ready to reveal the 1.0 of a project that's been in the works quietly for two years.
Introducing RainbowCake, a modern Android architecture framework
🌈🍰
#AndroidDev
Reminder: starting in Kotlin 1.8, the Kotlin Android Extensions Gradle plugin (which supplies synthetics for Views and Parcelize) will be gone. Screenshot here is using the 1.8 Beta.
Read this blog post about how to migrate:
Like previous technical writing courses by Google, this one about Writing Helpful Error Messages is brilliant, and everyone should read it:
After that, as a practice exercise: how would you change this Compose error message? 😃
I've been using requireNotNull quite a bit lately. For me, !! always seems like someone just wanted to quickly make code compile and didn't think nullability through, while this function signals the exact same intent more clearly.
Just learned that kotlinx.serialization can automatically perform polymorphic serialization on a sealed interface and its implementations, with no additional code required. Just throw `Serializable` on it and it works.
It's so simple and smooth 🤯
One of the best things that Kotlin has done for us is the safe call operator, because it eliminates the kind of inherently incorrect re-fetching of values after performing checks on them that we do all the time in Java for some weird reason.
Interested in testing coroutines on Android with the new coroutine testing APIs?
The recording of my talk Untangling Coroutine Testing from
@AndroidMakersFR
is now on YouTube!
Here's a late article for today, looking at some bits of Gradle config for Android that you can probably clean up in your project!
A Bit of Gradle Housekeeping 🧹
#AndroidDev
#GDE
Multipreview annotations for Compose are so awesome.
We're working on adding them to the Now in Android sample now, check out how much they simplify preview configuration:
Closing a chapter today, as this was my last day working at
@getstream_io
. Had an amazing time there, have nothing but good things to say of the Android and devrel teams.
Shout-out to Sam who pointed me there last summer 🙏
Now, a break until next year.
Android Studio has now caught up with IntelliJ versions enough to support rendered documentation comments 🎉 (1). Includes awesome support for Kdoc [refs] too!
You can enable this globally in Preferences (2), or toggle it on/off for individual comments in the gutter icons (3).
Looking to publish to MavenCentral after hearing the news about JCenter going away? I have good news!
I spent the better part of a day updating this massive publication guide for you:
#AndroidDev
#GDE
Anyone hiring Android engineers? Asking for a friend who's:
- Looking for an EU-remote role
- Active in the community
- Caught up on the latest frameworks
- Been working on the platform for almost a decade
Drop links in the replies - they'll see them!
Just caught the drama around this post
You have to be pretty out of touch to conduct yourself like this in such a great community. And especially to put down the work of
@skydoves
who's done an incredible amount of valuable open-source work.
Here's a story of iterating on upload progress code on Android, solving various problems along the way.
I especially enjoyed learning about the OkHttp Tag API to get to the final solution.
Adventures in Tracking Upload Progress With OkHttp and Retrofit
New blog post! First one in a while.
Join me on a journey of creating a custom macOS screen saver using Kotlin!
P.S. The journey is pretty long and complicated. Maybe just download and enjoy it.
The previous article about single view states did really well, so let's see if we can continue the trend. Here are some...
Thoughts about State Handling on Android
New article now out: a tutorial for building a functional chat app with
#JetpackCompose
and
@getstream_io
!
Detailed, step-by-step guide. Contains a lot of small tips about Compose APIs along the way. Feedback welcome!
#AndroidDev
#GDE
A
#JetpackCompose
confession: I still need to guess the order for Modifiers every time, and then I just fix it in the next iteration when I inevitably get it wrong.
Does anyone have a smart way of remembering how Modifier ordering works?
The API Guidelines doc by Google is hands down the most important resource for
#JetpackCompose
out there.
It explains conventions in great detail, and will also help you find out what parts of Compose you don't know yet.
Give it a read 👇
#AndroidDev
I've been sitting on this announcement for a bit, because it just didn't feel right to celebrate given everything going on, but...
As of a month ago, I am a Kotlin GDE, and as of this Monday, also an Android GDE! 😊
#Kotlin
#AndroidDev
#GDE
@GoogleDevExpert
Got some great news for the end of the week: I'm now a book author at
@rwenderlich
🎉
I jumped in as an author to update
@MateiSuica
's original chapters in the Data Structures & Algorithms in Kotlin book for the Second Edition.
Check out the book here:
My hobby: stopping the debugger at the point in the file where I want to add new code, and implementing as much of it as I can within the "Evaluate expression" feature.