Skip to main content

Kotlin ( a new programming language) for Android Development



Kotlin is a statically-typed programming language that runs on the Java Virtual Machine and also can be compiled to JavaScript source code or uses the LLVM compiler infrastructure. Its primary development is from a team of JetBrains programmers based in Saint Petersburg.
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.
Google just announced that it will officially support Kotlin on Android as a “first-class” language.

Kotlin tools will be included with Android Studio 3.0 by default, and JetBrains and Google are pledging to support the language going forward. Kotlin as a language has a lot of similarities to Java in structure — it's object oriented and statically typed, and designed for similar problems Java solves. But because it's a clean slate in many ways, Kotlin adds a lot of nice-to-have features, a much cleaner syntax, ideas from functional programming, and other enhancements over Java.


Using Kotlin for Android Development

Kotlin is a great fit for developing Android applications, bringing all of the advantages of a modern language to the Android platform without introducing any new restrictions:
·         Compatibility: Kotlin is fully compatible with JDK 6, ensuring that Kotlin applications can run on older Android devices with no issues. The Kotlin tooling is fully supported in Android Studio and compatible with the Android build system.
·         Performance: A Kotlin application runs as fast as an equivalent Java one, thanks to very similar bytecode structure. With Kotlin's support for inline functions, code using lambdas often runs even faster than the same code written in Java.
·         Interoperability: Kotlin is 100% interoperable with Java, allowing using all existing Android libraries in a Kotlin application. This includes annotation processing, so databinding and Dagger work too.
·         Footprint: Kotlin has a very compact runtime library, which can be further reduced through the use of ProGuard. In a real application, the Kotlin runtime adds only a few hundred methods and less than 100K to the size of the .apk file.
·         CompilationTime: Kotlin supports efficient incremental compilation, so while there's some additional overhead for clean builds, incremental builds are usually as fast or faster than with Java.
·         Learning Curve: For a Java developer, getting started with Kotlin is very easy. The automated Java to Kotlin converter included in the Kotlin plugin helps with the first steps. Kotlin Koans offer a guide through the key features of the language with a series of interactive exercises.




Packages

A source file may start with a package declaration:

package foo.bar
 
fun baz() {}
 
class Goo {}
 
// ...
All the contents (such as classes and functions) of the source file are contained by the package declared. So, in the example above, the full name of baz() is foo.bar.baz, and the full name of Goo is foo.bar.Goo.
If the package is not specified, the contents of such a file belong to "default" package that has no name.

A number of packages are imported into every Kotlin file by default:
·         kotlin.*
·         kotlin.annotation.*
·         kotlin.collections.*
·         kotlin.comparisons.* (since 1.1)
·         kotlin.io.*
·         kotlin.ranges.*
·         kotlin.sequences.*
·         kotlin.text.*

Additional packages are imported depending on the target platform:
·         JVM:
o    java.lang.*
o    kotlin.jvm.*
·         JS:
o    kotlin.js.*

The Kotlin Standard Library provides living essentials for everyday work with Kotlin. These include:
·         Higher-order functions implementing idiomatic patterns (letapplyusesynchronized, etc).
·         Extension functions providing querying operations for collections (eager) and sequences (lazy).
·         Various utilities for working with strings and char sequences.
·         Extensions for JDK classes making it convenient to work with files, IO, and threading

Packages

kotlin
Core functions and types, available on all supported platforms.
kotlin.annotation
Library support for the Kotlin annotation facility.
kotlin.browser
JS
Access to top-level properties (documentwindow etc.) in the browser environment.
kotlin.collections
Collection types, such as IterableCollectionListSetMap and related top-level and extension functions.
kotlin.comparisons
Helper functions for creating Comparator instances.
kotlin.concurrent
JVM
Utility functions for concurrent programming.
kotlin.coroutines.experimental
1.1
Library support for coroutines, including support for lazy sequences.
kotlin.coroutines.experimental.intrinsics
1.1
Low-level building blocks for libraries that provide coroutine-based APIs.
kotlin.dom
JS
Utility functions for working with the browser DOM.
kotlin.experimental
1.1
Experimental APIs, subject to change in future versions of Kotlin.
kotlin.io
IO API for working with files and streams.
kotlin.js
JS
Functions and other APIs specific to the JavaScript platform.
kotlin.jvm
JVM
Functions and annotations specific to the Java platform.
kotlin.properties
Standard implementations of delegates for delegated properties and helper functions for implementing custom delegates.
kotlin.ranges
Ranges, Progressions and related top-level and extension functions.
kotlin.reflect
Runtime API for Kotlin reflection
kotlin.reflect.full
JVM
1.1
Extensions for Kotlin reflection provided by kotlin-reflectlibrary.
kotlin.reflect.jvm
JVM
Runtime API for interoperability between Kotlin reflection and Java reflection provided by kotlin-reflect library.
kotlin.sequences
Sequence type that represents lazily evaluated collections. Top-level functions for instantiating sequences and extension functions for sequences.
kotlin.streams
JVM
1.1
JRE8
Utility functions for working with Java 8 streams.
kotlin.system
JVM
System-related utility functions.
kotlin.text
Functions for working with text and regular expressions.
org.khronos.webgl
JS
Kotlin JavaScript wrappers for the WebGL API.
org.w3c.dom
JS
Kotlin JavaScript wrappers for the DOM API.
org.w3c.dom.css
JS
Kotlin JavaScript wrappers for the DOM CSS API.
org.w3c.dom.events
JS
Kotlin JavaScript wrappers for the DOM events API.
org.w3c.dom.parsing
JS
Kotlin JavaScript wrappers for the DOM parsing API.
org.w3c.dom.svg
JS
Kotlin JavaScript wrappers for the DOM SVG API.
org.w3c.dom.url
JS
Kotlin JavaScript wrappers for the DOM URL API.
org.w3c.fetch
JS
Kotlin JavaScript wrappers for the W3C fetch API.
org.w3c.files
JS
Kotlin JavaScript wrappers for the W3C file API.
org.w3c.notifications
JS
Kotlin JavaScript wrappers for the Web Notifications API.
org.w3c.performance
JS
Kotlin JavaScript wrappers for the Navigation Timing API.
org.w3c.workers
JS
Kotlin JavaScript wrappers for the Web Workers API.
org.w3c.xhr
JS
Kotlin JavaScript wrappers for the XMLHttpRequest API.

For more information, please visit: http://www.osglsofttech.com
Mobile: +91-8650030309, 8650030308, info@osglsofttech.com


Address: Shanti Vihar, Behind Mahindra Showroom, Ajabpur Khurd, Dehradun

Comments

Popular posts from this blog

Why use an Inventory Management System?

Inventory management   software is a computer-based   system  for tracking   inventory  levels, orders, sales and deliveries. It can also be   used  in the manufacturing industry to create a work order, bill of materials and other production-related documents. Inventory  control is also  important  to maintaining the right balance of stock in your warehouses. You don't want to lose a sale because you didn't have enough  inventory  to fill an order. ... Too much  inventory  can trigger profit losses––whether a product expires, gets damaged, or goes out of season. ·          Real-Time Inventory by Category & Location Real time inventory provides comprehensive information’s in a format you currently use within a minute of the physical audit to be completed.   Real-Time Inventory   Control Software package allows you to manage all aspects of you...

Advanced PHP

Advanced PHP This segment will concentrate on some progressed PHP points, which will engage the per user to make dynamic web pages. Superglobals  A  global variable  is a variable declared at the top of the script outside the function. This variable is available to the complete script. Superglobal variables are arrays built into PHP. These superglobal variables are populated automatically with useful elements, and they are available in any scope. A superglobal array can be accessed within a function or a method without using the global keyword. PHP Superglobals $_COOKIE – It contains values provided to the script via HTTP cookies. $_GET – It contains variables submitted to the script using HTTP get method.  $_POST – It contains variables submitted to the script using HTTP post method.  $_REQUEST – It is a combined array containing values from the $_GET, $_POST, and $_COOKIES superglobal arrays.  $...

How SEO Can Help Your Business Grow

There are many businesses that lack a profound comprehension of the need for SEO experts. For this reason, they do not appreciate the fact that SEO can have a positive impact on the growth and development of their enterprises. It is very evident that  search engine optimization (SEO)  plays a vital role in creating an environment of online growth for businesses that understand the need for SEO consultants. What SEO Means To Businesses SEO is not only beneficial; it is a necessary marketing apparatus for the development of compelling brand consciousness. It is also means enhanced search engine page rankings and the amplification of a heightened abundance of traffic. So why shoulda SEO consultant be sought for and how can their assistance bring aboutprogressive business growth ? What Businesses Can Expect From Expert SEO Services When a business engages expert SEO services, the business will find quality because such services will provide the business with ...