💾 Archived View for dece.space › notes › 20220924-android-dev.gmi captured on 2023-11-04 at 11:21:28. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
Notes taken while developing Comet just so you can share a slice of my pie of incompetence and frustration.
Let's create a new a- oh great a new SDK version. Let's download an entire datacenter then.
OK we're done. Gradle syncs are still a thing; a terrible thing. AsyncTask is no more though, good riddance.
What the fuck is a scope? What the fuck is a ViewModel???? How are you supposed to understand how to implement one reading the overview??????? oh the docs leads to a… medium post but it uses the already deprecated ViewModelProviders. I'm not even surprised.
Let's read the "guide to app architecture" then since a few SDK bumps were enough to throw every knowledge off the window. Apparently LiveData is now how we implement observable data; fine because Java's observer interface is shit.
kotlinx.android.synthetic is deprecated btw, use viewBinding now. More magic shit! It looks nice, but every now and then the autogenerated binding class stops to resolve and the only solution is to "Invalidate caches and restart", absolutely fantastic.
In the mean time I found this top answer on SO lol
RecyclerViews are still unintelligible but at least I can copy paste old code, incredible.
Oh, exceptions in coroutines do not show in logcat, app just silently crashes.
Time to do some unit tests then. What could go wrong? Uri.parse always returns null because it has to run on an Android platform? OK. It won't install on my phone? Oh I missed an extra security option: I checked "USB debugging" but not "USB debugging (Security settings)". Of course!… Well Xiaomi wants me to connect to a Mi Account to check this box, so let's just run our tests in an emulator, shall we? It works but oooh does it take forever to launch.
Hey at least the new profiler is OK! When it does not freeze the entire IDE for literal minutes.
Back on track for 2022. Trying to detect network connectivity feels like a walk through the primal Deprecation Forest.
Apparently I have a version incompatibility between "com.google.android.material:material:1.4.0@aar" and "com.google.android.material:material:1.4.0@aar". Yes it is exactly the same string.
Just spent 30 minutes trying to understand why a fragment could not be found by ID but of course the solution was to invalidate caches and rebuild the whole project.
Trying to understand navigation by browsing stackoverflow and everyone is lost and every answer is precisely the type of code Google wanted to deprecate with their new shenanigans, what a joke.
mildly useful links: