Using retrofit, we can define http endpoints in a type safe way: interface BackendService getChores() : addChoreDto: AddChoreDto) : Call The very first step was adding and getting chores from the server. The Process Consuming REST api with Retrofit I've used Retrofit before and had very positive experience with it.Īpart from that, it integrates nicely with RxJava. This is a type safe http client, handling all serialization and deserialization into user defined classes behind the scenes. It provides a way to chain and combine asynchronous flows of data. It usually leads to callback hell and complex state management. Traditionally it is done by listening to user input/IO and then changing state as a reaction to these events. We still need a way to glue these sources with the app. UI needs to be responsive at all times - that's why they need to be handled on a different threads. RxJava 2Īlmost every mobile app has at least two asynchronous sources of data - user input and IO (network/storage). Kotlin surprised me also with its great compile time (almost matching Java). It is already stable and has an excellent IDE support. Kotlin is JVM language which makes it compatible with existing Java libraries (RxJava and Retrofit being some of them).Īpart from that Kotlin is more functional than Java which helps to deal with the approach imposed by RxJava. The remaining decision was language and stack for it. I am a backend developer and my go-to language is Scala, so the choice for server side was quite clear.įor client side I decided to go with Android since doing house chores is highly mobile activity.Ĭonsidering nature of house chores, mobile client seemed like a good idea. The idea was to define a set of chores and assign them to users periodically.Įvery night, chores for the upcoming day are distributed to users (based on what they have done in the past). Recently I decided to create a pet project which would help me and my girlfriend split house chores.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |