Quick summary of my past 9-day week
Tags: android, learning, 100daysofcode
Published: 2023-08-22 14:01:04

18 days ago I took a [challenge](https://dev.to/danielrendox/finding-my-blogging-path-lessons-from-my-journey-31d1#challenge) for myself that focuses on learning and building in public. It’s time to reflect on what I’ve achieved.

In this post, I decided not to beat around the bush and quickly summarize what I did during the last 9 days and go on.

My week consists of 9 days now 😁, but that’s OK because I planned the challenge to last 2 months, not 8 weeks. It started on the 4th of August and will finish on the 4th of October, so I have 61 days in fact. Is it a legitimate move? 🤔 Should be.

## Quick summary

Anyway, during this week I focused on managing state in Android. It’s important because otherwise, we lose user’s input when they turn the screen, switch to dark/light mode, etc. The same happens when the system kills the app’s process to save memory.

That’s not as easy as it looks! Using `remember { mutableStateOf() }` is not enough, unfortunately.

We also have side effects — code that goes out of the scope of a composable function. Philipp Lackner has a [great video](https://youtu.be/gxWcfz3V2QE?si=bHJGyPhqVLggyhIO) on this topic. But watching it is not enough for understanding. So I played around with it.

Also struggled to understand `derivedStateOf`, but the answers to [my question in Kotlin Slack](https://slack-chats.kotlinlang.org/t/14159421/can-anyone-help-me-understand-an-example-from-the-https-deve#992aa322-3a3a-489b-83e5-3e6a83eb8ee0) and some research made it clear. In short, use `derivedStateOf` only in rare cases. But in those rare cases, it’s extremely useful for performance.

Also learned new things about Gradle. Mainly that we can use different product flavors for `minSdk`. So I refactored [my project](https://github.com/DanielRendox/RoutineTracker) to use core library desugaring only when running on devices with Android versions less than 26.

Found out how to create a release APK version. And finally relieved when my app launched faster on release than on debug. That’s because I had thought there was a performance issue and I did smth wrong. 🤨

## Learning resources

Here are the resources that helped me learn this.

### Advanced state and side effects

1. [Advanced State and Side Effects in Jetpack Compose  |  Android Developers](https://developer.android.com/codelabs/jetpack-compose-advanced-state-side-effects)
2. [Should You Use Compose State or StateFlow in Your ViewModels?](https://youtu.be/T8vApYJlW8o?si=JR058ZQU4S7sTOAY)
3. [Full Guide to Jetpack Compose Effect Handlers](https://youtu.be/gxWcfz3V2QE)
4. [My question in Kotlin Slack about derivedStateOf](https://slack-chats.kotlinlang.org/t/14159421/can-anyone-help-me-understand-an-example-from-the-https-deve#992aa322-3a3a-489b-83e5-3e6a83eb8ee0)
5. [Gabor](https://twitter.com/Zhuinden) explains how to create a state holder but one that can be saved in `SavedStateHandle` and thus will survive the process death — [What is the best way to pass a default/initial value to a Jetpack Compose TextField?](https://stackoverflow.com/questions/76767202/what-is-the-best-way-to-pass-a-default-initial-value-to-a-jetpack-compose-textfi)

### Gradle

1. [Sorting and Reporting Your Dependencies with Gradle with Ed George, Android Worldwide](https://youtu.be/4PCCiEThhbE)
2. [Gradle for Beginners (Build Types, Product Flavors, Build Variants, Source Sets)](https://youtu.be/o0M4f5djJTQ?si=N5AfXiFfz6_ZJaXX)

## Progress

This week I decided to focus on learning. Although I added some features to my recent learning project, I didn’t work on my real app. 

AFAIK, here are the main concepts that I need to know to build an MVP:

1. Android basics
2. Kotlin
3. Jetpack Compose basics
4. Advanced state, side effects, and Gradle ◀️
5. Navigation and performance
6. Advanced Kotlin, Coroutines, and Flow
7. Databases and modularization
8. Dependency injection
9. Architecture (MVVM, MVI)

◀️ — Where I was in the past week

---

So I’m glad to increase this “Learn Android” bar by 5% 🎉

![Two lables and progress bars: 1. Make my app — 5%, 2. Learn android — 45%.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cvnbv1btaknhtqbehl44.jpg)

Make my app still remains at 5%. I used to feel bad about it, but in the past week, I realized something that ended that feeling. I’ll probably make a separate blog post about it.

---

Performance adjusted to the brand new 9-day week 🙃

### [My challenge](https://dev.to/danielrendox/finding-my-blogging-path-lessons-from-my-journey-31d1#challenge)

✔️ 5/6 tweets

✅ 1/1 article (this one)

### [VC’s Healthy Habits challenge](https://dev.to/virtualcoffee/join-virtual-coffee-in-the-healthy-habits-for-happy-devs-monthly-challenge-5b7h)

✔️ **Programming:** 45/48

☑️ **Household:** did at least 1 household chore 6 days a week

☑️ **Physical activity:** 6/6 times

☑️ **Rest:** had at least 1h each day

😱 **Learn English:** 14/42

☑️ **Daily review:** summarized what I did every day

### Updates to the challenge

It’s great to start small and then improve over time. So here are my improvements to the challenge’s rules:

➕ New habit — **Follow the schedule** every day. I discovered that I am still out of sync with my defined schedule. So I tweaked it and added this habit. This is mainly to get up at 7 AM and close my eyes at 11:30–12:00 PM.

⬆️ **Work 1h more each day.** This is actually not a problem for me. I usually work more than planned because I love programming and can’t put it aside. My problem is to not forget about other activities and not take their time. But as I said, I changed my schedule and now it should be OK.

⬆️ **2 articles a week** (or 9 days 😁). I have a lot of ideas, drafts, and notes, but can’t find time for writing. 

## Ending

I wrote this article for myself mainly. But if you read this far, thanks for being interested in me. 🤗

If you're learning Android and struggling with some of these topics, you can dm me on [Twitter](https://twitter.com/DanielRendox) or email me (daniel.rendox@gmail.com) and we'll figure it out together.