About choosing a language for AOS development
In this post, I discuss my language choices and share my process when developing AOS.
Now that I’m in charge of developing the app, I’m prioritizing learning AOS. In AOS, development can be done in one of two languages. Java and Kotlin. Our existing app is composed of webview through Java, but I’m learning Kotlin. I thought I’d write a little retrospective on why I made this decision, because I’m thinking about refactoring to Kotlin code.
I analyzed the pros and cons of each language when creating an Android app.
First, let’s talk about Java.
Advantages of Java
- Preferred language of the Android ecosystem: it has been the main language for Android app development for a long time.
- Plenty of resources: Many development tools, libraries, frameworks, documentation, etc. are built on top of Java.
- Community support: There is a lot of troubleshooting and support for Android apps developed in Java.
- Cross-platform development: Java is a language used not only on Android but also on other platforms, making it useful for cross-platform development.
Disadvantages of Java
- Higher code volume: Java has a more complex syntax than Kotlin and can be a higher code volume.
- Lack of null stability: Java lacks support for null handling and can be prone to NullPointerException.
The following is about Kotlin
Advantages of Kotlin
- Concise and efficient syntax: Kotlin has a more concise and efficient syntax, which improves development productivity.
- Null reliability: Kotlin has unambiguous support for nullable and non-nullable types, which increases stability.
- Interoperability with Java: Kotlin is highly compatible with existing Java code and makes it easy to use Java libraries.
- Official Android support: Kotlin has been designated by Google as an official language for Android, which means it is getting better support and optimization.
Cons of Kotlin
- Relatively new language: Compared to Java, Kotlin is a relatively new language, so developers may need time to get used to it.
- Build times: Kotlin can have long build times, which can slow down builds on larger projects.
Conclusion
Ultimately, the choice of language depends on developer preference and project requirements. Kotlin is recognized as a superior language to Java in most respects and is often used as the first choice for Android development. However, when you need to maintain a project that was previously developed in Java, it can also make sense to choose Java.
In our project, we have Android development in Java, but it’s only implemented as a webview, and we don’t have any app developers, so we’re learning from scratch. This, combined with the fact that the amount of code to be maintained is relatively small, led to the decision to refactor the code with little risk.