Monday, 22 May 2017

Kotlin Basics

Install in Studio

Go to File --> Settings -->Pluins-->install jet brains plugin-->select kotlin -->Download and install

Restart IDE

Sample Project
--------------------
Create new project
Open MainActivity and then type ctrl+Alt+shft+k
File gets converted to kotlin file

Access UI components in Kotlin file
---------------------------------------------------
Add this import in MainActivity.java "import kotlinx.android.synthetic.main.activity_main.textView;"

Access directly in oncreate as follows

textView.setText("This is kotlin example")


Done build and run:)

No comments:

Post a Comment

Pass a HashMap from Angular Client to Spring boot API

This example is for the case where fileData is very huge and in json format   let map = new Map<string, string>()      map.set(this.ge...