2015年9月6日 星期日

Kotlin for Android Developers ( Part 1 )



  1. Open Android Studio
  2. Go to Plugins ( you can use find action shortcut: shift + command + a on Mac and type plugins )
  3. Find ( search for Kotlin) and install
  4. Restart Android Studio when done downloading
  5. Go to your project (or create a new Android project)
  6. Convert Java File to Kotlin
  7. After waiting for IDE to complete conversion , Configure Kotlin, leave everything by default

  8. Add one line in the module Gradle file for Kotlin Android dextension kotlinx.android.sythetic.<layout_xml>.* to work
         classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"  
    
  9. Sync Gradle 
  10. If you have any trouble , check the official document.

沒有留言:

張貼留言