DEV Community

Discussion on: I am Android Developer with Java and Kotlin, Ask Me Anything!

Collapse
 
andy profile image
Andy Zhao (he/him)

Has Kotlin gained enough momentum and maturity where you would recommend it to new Android developers instead of learning Java?

Also, strictly for learning Android development, what are some pros and cons of learning Kotlin first vs Java first?

Collapse
 
architectak profile image
Ankit Kumar

During the I/O keynote, Google announced that they were making Kotlin an officially supported language for Android development. As of the 3.0 Preview, Android Studio ships with Kotlin support built-in, so creating an Android project that understands Kotlin code is now as easy as selecting a checkbox in Android Studio’s project creation wizard.

title : Kotlin vs Java

  • succinct code – with no findViewByIds

textView.setText("Hello World") - kotlin

TextView text = (TextView) findViewById(R.id.textView);

text.setText("Hello World");
Java need two line for same work.

  • Kotlin is null safe by default

  • Extension functions

Kotlin support

  • Coroutines are first-class citizens

  • There are no checked exceptions

  • Native support for delegation

  • Data classes
    And many more.