Live data from Hacker News

Ask HN: Expert Advices for New Learners in Android Kotlin Development?

news.ycombinator.com

11–18 of 18 posts

Re: Ask HN: Expert Advices for New Learners in Android Kotlin Development?

#11
post #6

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.

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?

#12
post #6

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.

I will use React Native when it reaches v1.0.

Re: Ask HN: Expert Advices for New Learners in Android Kotlin Development?

#13
post #5
post #3

I 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…

Kotlin Coroutines works just fine on servers? What's the issue? BTW with Loom you won't need coroutines anymore, regular threads would work fine and be simpler/more scalable.

Re: Ask HN: Expert Advices for New Learners in Android Kotlin Development?

#14
Don't jump fully into Jetpack Compose yet. While in theory it looks nice, something similar to ReactJS coming from web dev side, there are still a lot of papercuts and not implemented features. Use classic xml layouts, but keep an eye on Compose updates.

Re: Ask HN: Expert Advices for New Learners in Android Kotlin Development?

#15
post #6

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.

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.

KMM is also in alpha so I wouldn’t recommend using it in production.

Re: Ask HN: Expert Advices for New Learners in Android Kotlin Development?

#17
The best pieces of advice that I can share from experience:

Do 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.

Post reply on HN