Why use Kotlin when you can build it in React Native, and get an iOS counterpart for essentially free out of the codebase? Curious as to why a new learner would go this route.
Ask HN: Expert Advices for New Learners in Android Kotlin Development?
11–18 of 18 posts
Re: Ask HN: Expert Advices for New Learners in Android Kotlin Development?
#12Why use Kotlin when you can build it in React Native, and get an iOS counterpart for essentially free out of the codebase? Curious as to why a new learner would go this route.
Re: Ask HN: Expert Advices for New Learners in Android Kotlin Development?
#13I started dabbling in Android App Development in 2009, and did it full-time since 2011. I started using Kotlin a few years ago. Get familiar with using Android Studio as your IDE. Read the Kotlin and Android documentation. Look at the (newer) Android example apps Google puts up on Github. Watch the (especially more recent) Android Developer videos on Youtube, especially the I/O ones (although some other deep dive one…
Lifecycle is one of those things that earns a native mobile developer's salary. It's the selling point where native beats hybrid, as well as web. The other might be threading. Kotlin Coroutines and Flow is incredibly powerful and one of the coolest things on any system. I wish this kind of thing was available for servers and such. I'd argue that Looper and Handlers are deprecated once you understand Coroutines and Fl…
Re: Ask HN: Expert Advices for New Learners in Android Kotlin Development?
#14Re: Ask HN: Expert Advices for New Learners in Android Kotlin Development?
#15Why use Kotlin when you can build it in React Native, and get an iOS counterpart for essentially free out of the codebase? Curious as to why a new learner would go this route.
Kotlin Multiplatform lets you share code between iOS and Android, writing only the UI code with SwiftUI and the rest is shared. You can also run Compose UI on the desktop so you don't need a web app.
Re: Ask HN: Expert Advices for New Learners in Android Kotlin Development?
#16Re: Ask HN: Expert Advices for New Learners in Android Kotlin Development?
#17Do not do eager work at process startup (application onCreate, content provider onCreate, etc). Your process starts up for many different reasons, and work done there except for a narrow subset (crash reporting setup) is unlikely to apply to all of them. However, once the code is there it's hard to find what else might be depending on it later.
Do not use inheritance to share code. Androids APIs were designed to point you in this direction, but overrides upon overrides will make your life miserable. Once you have a base class from Hilt or AppCompat to provide composition for you (via DI or lifecycle), add no further layers of inheritance.
Avoid the event bus pattern. It was fashionable for a while but it turns the codebase to spaghetti. It tends to make error handling impossible or at least convoluted and debugging is a huge challenge.