If I wanted to poke around with some hobby projects, where would be the best place to start from scratch with all the best practices and development tools?
If I wanted to poke around with some hobby projects, where would be the best place to start from scratch with all the best practices and development tools?
read the kotlin koans (assuming you are not familiar with kotlin), they are the best way to get used to that language if you know java, and kotlin is much more pleasant to use than java
Best practices and tools might be harder, a LOT has changed in the past 7 years.
Maybe https://github.com/ZacSweers/CatchUp as a sample ?
After that, it depends whether your hobby is to write an android app, or if the resulting product is hobby.
if it is the former, Compose is lots of fun and will be a big leap in android development. You can already use the dev version.
MVI has also deeply changed how I code Android apps. Again, maybe not needed for the level of complexity of an hobby app unless you want to toy with something different.
It does sound very familiar ! Yeah there is nothing new there (and MVI on Android having been heavily influenced by what's going on on other platforms is readily acknowledged).
It is newish (it has been there for several years now) as far as "trendy" Android architecture patterns go.
We started with a bad implementation of MVC for several reasons :
- what Google ended with (which does not look like it fits what they initially intended, but I digress) with its god Activities has encouraged the community to go in that direction.
- when Android was first released, the smartphones of the time were heavily CPU and memory constrained. The way applications were built was to best fit these constraints (sometimes in naive ways).
And again, I am not advocating for all problems to use MVI or that it is the one architecture to rule them all. Just something interesting that was very likely not in gp mind 7 years ago.
so you have
- the state, only containing pure java/kotlin objects)
- reducers to handle state changes. Basically a reducer is a method that takes a state as input (and often another parameter, like e.g. an user input) and creates another state as output.
- and a model of your ui, that is created from each state.
This works very well to have fully testable business logic (which is where the no Android objects is nice, so tests can just run on the JVM) and think about how both state and view changes (both state and view states are immutable, and are altered by copy).
Again, not necessarily something I say that grandparent absolutely needs, but if they want to try something new, it is there.