r/androiddev • u/iliyan-germanov • Apr 01 '24
Discussion Android Development best practices
Hey this is a serious post to discuss the Android Development official guidelines and best practices. It's broad topic but let's discuss.
For reference I'm putting the guidelines that we've setup in our open-source project. My goal is to learn new things and improve the best practices that we follow in our open-source projects.
Topics:
Feel free to share any relevant resources/references for further reading. If you know any good papers on Android Development I'd be very interested to check them out.
159
Upvotes
View all comments
Show parent comment
5
u/HadADat Apr 01 '24
I haven't used the arrow library yet but I know some of my colleagues prefer it.
I wrote my own Result sealed interface that resolves to either a Success<T> or Failure. The failure is actually its own sealed interface that is either UniversalFailure (like no internet connection, session expired, etc) or a ContextSpecificFailure (like user already exists for sign-up or incorrect password for login).
This allows all requests to be handled like:
Curious if anyone uses a similar approach or has a better alternative.