Android Jetpack Compose is a modern UI toolkit introduced by Google for creating native Android apps. It is built with the goal of simplifying the process of building user interfaces while also promoting a more efficient, reactive, and declarative approach. Introduction Android Jetpack Compose is a modern, reactive framework for building user interfaces in Android applications. It was introduced by Google in 2020 and has since become a popular choice among Android developers. The framework provides a more concise and expressive way to build UI compared to traditional Android UI frameworks like XML-based layouts. Compose is built with a focus…
-
-
Before you dive deeper into Kotlin’s features, go back to DetailActivityKotlin.kt and replace the contents of the file with the following: package com.tejsumeru.android.omgandroid import android.content.Intent import android.os.Bundle import android.support.v4.view.MenuItemCompat import android.support.v7.app.AppCompatActivity import android.view.Menu import android.widget.ImageView import android.support.v7.widget.ShareActionProvider import com.squareup.picasso.Picasso class DetailActivityKotlin : AppCompatActivity() { private val imageUrlBase = "http://covers.openlibrary.org/b/id/" private var imageURL = "" private var shareActionProvider: ShareActionProvider? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_detail) actionBar?.setDisplayHomeAsUpEnabled(true) val imageView = findViewById<ImageView>(R.id.img_cover) val coverId = this.intent.extras.getString("coverID") val len = coverId?.length ?: 0 if (len > 0) { imageURL = imageUrlBase + coverId + "-L.jpg" Picasso.with(this).load(imageURL).placeholder(R.drawable.img_books_loading).into(imageView) } } private fun setShareIntent() { val…
-
Animation is a method in which a collection of images are combined in a sepecific way and processed then they appear as moving images. Building animations make on-screen objects seems to be alive. Android has quite a few tools to help you create animations with relative ease. so in this article we will learn to create animations using Kotlin. below are some attributes which we are using while writing the code in xml. Table of Attributes : XML ATTRIBUTES DESCRIPTION android:duration It is used to specify the duration of animation to run android:fromAlpha It is the starting alpha value for…
-
Kotlin KOTLIN is a cross platform, statically types, general purpose programming language with type inference. KOTLIN is designed to interoperate fully with java but type inference allows its syntax to be more concise.KOTLIN is sponsored by JetBrains and Google through the Kotlin Foundation. Java JAVA is an Object Oriented Programming Language developed by JAMES GOSLING and colleagues at SUN MICRO SYSTEMS in 1991.The language was initially called OAK. It was developed as a full fledged programming language in which one can accomplish the same sorts of tasks and solve the similar problems that one can do in other programming languages such as BASIC,C++ etc. Using Kotlin…
-
String is a sequence of characters. In this guide, we will see how to declare, use and manipulate strings in Kotlin. Declare a String in Kotlin There are whole bunch of ways we can define a String in Kotlin. Lets have a look at the following example, here we have declare two immutable strings website & longString and we have also declared two mutable strings name & lName. package tejprogramming fun main(args : Array<String>){ /** * These Strings are Immutable which * means they are read-only and * unchangeable */ val website = "Tej Sumeru" /** * This is how we declare long strings */ val longString…
-
[vc_row][vc_column][vc_column_text]Kotlin is a statically-typed programming language, developed by JetBrains. If you have basic knowledge of Java, you will be able to learn Kotlin in no time. This Kotlin tutorial is designed for beginners so you would be able to understand Kotlin programming even if you have no knowledge of Java. Kotlin and Java are interoperable which means you can use them together in a Project as well as you can re-write a Java code in Kotlin efficiently. The syntax of Kotlin is concise than Java. In this tutorial you will learn why use Kotlin, what are the advantages of it and several guides…
-
Basically, the one screen of mobile is knows as Activity in Android. Android Activity Lifecycle is controlled by 7 methods which are included in android.app.Activity class. The android Activity is the subclass of ContextThemeWrapper class. An activity is the single screen in android. It is like window or frame of Java. By the help of activity, you can place all your GUI components or widgets in a single screen. The activity goes from one state to another which is known as activity lifecycle. Methods Of Activity Lifecycle Method Description onCreate called when activity is first created. onStart called when activity…