You are on page 1of 13

KOTLIN-ANDROID

DEVELOPMENT
BY 
MOHD AYAAZ ANSARI
PRABAL SHARMA
AVI TYAGI
INTRODUCTION
•Kotlin is a cross-platform,statically typed,general-purpose programming language
with type inference. 

•Kotlin is designed to interoperate fully with java, and jvm version of kotlin
standard library depends on the java class library,but type inference allows its
syntax to be more concise. 

•Kotlin mainly targets the jvm , but also compiles to javascript(e.G. For frontend
web applications using react) or native code via llvm(e.G, for native ios apps sharing
business logic with android apps). 

•Language development costs are borne by jet brains,while the kotline foundation
protects the kotlin trademark 

• On 7 may 2019,google announced that the kotlin programming language is now


its preferred language for android app developers. 
•Since the release of Android Studio 3.0 in October 2017, Kotlin has been included
as an alternative to the standard Java compiler.

• The Android Kotlin compiler produces Java 8 bytecode by default (which runs in
any later JVM), but lets the programmer choose to target Java 9 up to 17, for
optimization,or allows for more features; has bidirectional record class
interoperability support for JVM, introduced in Java 16, considered stable as of
Kotlin 1.5.

•Kotlin support for compilation directly to JavaScript (i.e., the classic back-end) is
considered stable since version 1.3, while the new Kotlin/JS(IR) is in beta as of
version 1.5.30. The new optimized implementations of Kotlin/JVM(IR) and Kotlin/JS
(IR-based) were introduced in version 1.4. Kotlin/JVM(IR) is considered stable and
enabled by default since version 1.5. Kotlin/Native (for e.g. Apple silicon support) is
considered beta since version 1.3.
•In July 2011, JetBrains unveiled Project Kotlin, a new language for the JVM, which
had been under development for a year.

•JetBrains lead Dmitry Jemerov said that most languages did not have the features
they were looking for, with the exception of Scala. 

• he cited the slow compilation time of Scala as a deficiency.

•One of the stated goals of Kotlin is to compile as quickly as Java. In February 2012,
JetBrains open sourced the project under the Apache 2 license

•The name comes from Kotlin Island, near St. Petersburg. Andrey


Breslav mentioned that the team decided to name it after an island, just like Java
was named after the Indonesian island of Java (though the programming language
Java was perhaps named after the coffee rather than the island).[
LANGUAGE
•Kotlin Data Types-Integer Data type,Floating-point Data Type,Boolean Data
Type,Character Data Type

•Kotlin Variables variables are declared using two types -Immutable


using val keyword,Mutable using var keyword

•Kotlin Operators -Arithmetic operator,Relation operator,Assignment


operator,Unary operator,Logical operator,Bitwise operator 

• Kotlin Standard Input/Output- print() function , println() function

•Kotlin Type Conversion-  helper function can be used to convert one data type into
another:  toByte() ,toShort() ,toInt() ,toLong() ,toFLoat() ,toDouble() ,toChar() 
• Kotlin Expression- An expression consists of variables, operators, methods calls
etc that produce a single value.

• Kotlin Statement –A statement is the syntactic unit of any programming


language that expresses some action to be carried out. 

• Kotlin Block –A block is a section of software code enclosed with curly braces
({…}). A block can consist of one or more statements, preceded by the
declarations of variables.

•    Kotlin if-else expression-if expression,if-else expression,if-else-if ladder expre-     


 -ssion,nested if expression

• Kotlin while loop-It consists of a block of code and a condition. 


• Kotlin do-while loop -do-while loop is a control flow statement which executes a
block of code at least once without checking the condition, and then repeatedly
executes the block, or not, it totally depends upon a Boolean condition at the
end of do-while block.

• Kotlin for loop-for loop is equivalent to foreach loop of other languages like C#.


Here for loop is used to traverse through any data structure which provides an
iterator.

• Kotlin when expression-when can be used in two ways: when as a


statement,when as an expression 

• Kotlin Unlabelled break-When we are working with loops and want to stop the
execution of loop immediately if a certain condition is satisfied, in this case, we
can use either break or return expression to exit from the loop
APPLICATIONS
•Language and environment are mature

• It makes Android development much easier

•It’s seamlessly integrated with Android Studio

•Its evolution is well covered

•It’s much safer than Java


•There are well-known companies that already use it in production

•Companies are starting to ask for it on their job offers

•Kotlin is multi-platform

•Micro-niches are very profitable

• It’s very easy to learn


Conclusion

You might also like