Answers for "kotlin tutorial"

1

kotlin for beginners

1. OPEN ANDROID STUDIO 
1. MAKE NEW PROJECT IN KOTLIN 
3. COPY PASTE THE BELOW LINES OF CODES IN XML AND MAIN ACTIVITY RESPECTIVILY

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/tv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
  
  
  
  
Package com.example.firstkotlinproject

import android.annotation.SuppressLint
import android.os.Bundle
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity

class MainActivity : AppCompatActivity() {
    @SuppressLint("SetTextI18n")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        supportActionBar?.hide()

        val tv : TextView = findViewById(R.id.tv)
        tv.text = "first kotlin project"

    }
}
Posted by: Guest on November-15-2021
1

kotlin syntax

fun main(args : Array<String>) { 
  println("Hello World") 
}
Posted by: Guest on September-08-2021
1

kotlin syntax

val x = 5
val y = 6
println(x + y) // Print the value of x + y
Posted by: Guest on September-08-2021
0

kotlin with

with(file){
    load()
    modify()
    save()
}
Posted by: Guest on April-20-2021
0

kotlin vs java

Kotlin is a language built on and entirely backwards-compatible with Java.
While Java is Object-Oriented first, Kotlin supports a blend
of OO and functional paradigms. For further information, refer to
kotlinlang.org
Posted by: Guest on November-07-2020
2

Kotlin Tutorial Android for beginners

1. OPEN ANDROID STUDIO 
1. MAKE NEW PROJECT IN KOTLIN 
3. COPY PASTE THE BELOW LINES OF CODES IN XML AND MAIN ACTIVITY RESPECTIVILY

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/tv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
  
  
  
  
Package com.example.firstkotlinproject

import android.annotation.SuppressLint
import android.os.Bundle
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity

class MainActivity : AppCompatActivity() {
    @SuppressLint("SetTextI18n")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        supportActionBar?.hide()

        val tv : TextView = findViewById(R.id.tv)
        tv.text = "first kotlin project"

    }
}
Posted by: Guest on November-15-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language