• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Android and Java, is it still OK to start with Java?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

Please advise.
 
Saloon Keeper
Posts: 7355
170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.

It's perfectly OK to use Java. All the core Android libraries, as well as Google's Jetpack/AndroidX libraries, is fully compatible with Java as well as Kotlin, and will remain to be so for the foreseeable future. That's why you'll see code examples in both languages in the Android documentation, for example in https://developer.android.com/topic/libraries/architecture/workmanager/basics
 
Saloon Keeper
Posts: 25640
183
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Conversely, there are still some good books and sites using Java that are still valuable.

Yes, in the long run, Kotlin would be the better way to go, but one good thing about Android Studio is that you can write in Java and have it automatically convert to Kotlin you you can get a good intro to Kotlin based on your own code as examples.
 
Sami radwan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.



In this case which one should I focus on?
 
Tim Moores
Saloon Keeper
Posts: 7355
170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sami radwan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.



But I'm wondering if I will fcae any issues? for example I may follow a video tutorial and dfind something nkt working because it is outdated?
 
Tim Moores
Saloon Keeper
Posts: 7355
170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Stuff on the net isn't always up-to-date, that's just a fact of life. But that's always a risk, no matter what language or technology you use. In most cases it's not hard to find more current material.
 
Sami radwan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any good reason why to pick Java other than finding tutorials?
 
Tim Moores
Saloon Keeper
Posts: 7355
170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just a few off the top of my head:

Because you're already familiar with it

Because you can use it elsewhere more easily than Kotlin

you can always convert Java to Kotlin if necessary (whereas the reverse is not generally true)



...
 
Tim Holloway
Saloon Keeper
Posts: 25640
183
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I should mention that the app that I wrote for grocery shopping is still in Java.

I had to change a LOT of the java code, since the original version ran somewhere back around Cupcake, but as of the moment, I haven't bitten the Kotlin bullet.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic