Tim Holloway wrote:Welcome to the Ranch, Sami!
Unfortunately, since Android doesn't adhere as strongly to Java's backwards-compatibity mindset as "real" Java does and mutates radically quite frequently, it's pretty likely that even Kotlin examples can be out of date. Especially anything that comes to asynchronous processing.
Tim Moores wrote:Java. As Tim H said, you can always convert Java to Kotlin if necessary (whereas the reverse is not generally true). And there are many more Android books and examples out there than Kotlin ones, so it'll be easier to get started with.
you can always convert Java to Kotlin if necessary (whereas the reverse is not generally true)
Sami radwan wrote:I know that Google is now prfer Kotlin. I'm a beginner and would like to learn Abdroid development. I started with Java fundamentals and now learning about collections. Should I stop and move to Kotlin? or ia it OK if I continue with Java if my goal is to build Android apps? I'm just worrying that I may face issues in Android tutorials with Java? they could be outdated for example?
Tim Holloway wrote:This is not due to language-related obsolescence, it's due to a lack of quality in architectural definitions. Indeed, Android is probably carrying a lot of bloat by now, since it does at least tend to support obsolete services of several different generations.
Tim Holloway wrote:Up until now, I've been answering the question, "Is it still OK to start with Java". And (so far) my answer is yes.
However, Kotlin the language has been adopting constructs to make Android development less warty. It's still at the point where there are Java equivalents, but the Kotlin counterparts are more streamlined. Some of the improvements do have the intent of making it easier to deal with the sideways tasking model that Android is based on.
So after all of the above, if you have serious intentions of becoming an Android developer and you don't have a Java legacy to leap from, there's a good case to be made for starting with Kotlin. Again, Kotlin is being tuned to be Android friendly and Java (for the most part) is not. Plus a lot of the move to Kotlin has been made to ensure that Oracle doesn't someday win a lawsuit that makes it prohibitive to use Java for Android development. They haven't done well so far, but the US Justice System is no longer very consistent. Well, less so even than before.
I still maintain that regardless of the language, an architecture where the GUI is the main thread and the business logic has to hang off of it as opposed to the other way around is a really horrible concept. But Android is stuck with it.