4 ms·
I haven't touched Android development in... Maybe 7 years? And even then, wasn't really in the trenches. I have to imagine boat loads have changed since then.
by tjbiddle 6y ago
I haven't touched Android development in... Maybe 7 years? And even then, wasn't really in the trenches. I have to imagine boat loads have changed since then.
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?
- on_and_off 6y agoDownload Android Studio, 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 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.
- scns 6y agoWhat is MVI?
- sdiw 6y agoModel-View-Intent, I guess.
- lubonay 6y agoMVI stands for Model-View-Intent. It's a state management pattern that uses unidirectional flow. Basically you send events (Intents, similar to Redux actions, not to be confused with the Android Intent class..) to your Model, which does a state update and sends out the updated state to the View.
- scns 6y agoAh okay. Seems to be another name for Model View Update aka The Elm architecture aka Flux pattern.
- on_and_off 6y agoI just skimmed https://guide.elm-lang.org/architecture/buttons.html https://guide.elm-lang.org/architecture/buttons.html . 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.
- on_and_off 6y agoto add on top of what lubonay wrote, this unidirectional data flow allows to solve a wide range of problem in how we handle state (and its changes). 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.
- insin 6y agoFrom not having done any Android development before, I've found Flutter great for hobby projects which scratch personal itches.