Found 1952 Articles for Apps/Applications

How to handle swipe gestures in Kotlin?

Azhar
Updated on 20-Apr-2020 13:13:11

5K+ Views

This example demonstrates how to handle swipe gestures in an android device using Kotlin.Step 1 − Create a new project in Android Studio, go to File ⇉ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     Step 3 − Add the following code to src/MainActivity.ktpackage app.com.kotlinapp import android.os.Bundle import android.widget.RelativeLayout import android.widget.Toast import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() {    private lateinit var layout: RelativeLayout    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main)       layout = findViewById(R.id.relativeLayout)   ... Read More

How to track the current location (Latitude and Longitude) in an android device using Kotlin?

Azhar
Updated on 20-Apr-2020 13:07:00

3K+ Views

This example demonstrates how to track the current location (Latitude and Longitude) in an android device using Kotlin.Step 1 − Create a new project in Android Studio, go to File ⇒New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.             Step 3 − Add the following code to src/MainActivity.ktpackage app.com.kotlipapp import android.Manifest import android.content.Intent import android.content.pm.PackageManager import android.location.Location import android.net.Uri import android.os.Build import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.provider.Settings import android.util.Log import android.view.View import android.widget.TextView import android.widget.Toast import androidx.core.app.ActivityCompat import com.google.android.gms.location.FusedLocationProviderClient import com.google.android.gms.location.LocationServices class ... Read More

How to create a notification alert using Kotlin?

Azhar
Updated on 20-Apr-2020 12:57:49

2K+ Views

This example demonstrates how to create a notification alert using Kotlin.Step 1 − Create a new project in Android Studio, go to File ⇒New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     Step 3 − Add the following code to src/MainActivity.ktpackage app.com.kotlinapp import android.app.* import android.content.Context import android.content.Intent import android.graphics.BitmapFactory import android.graphics.Color import android.os.Build import android.os.Bundle import android.view.View import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() {    lateinit var notificationChannel: NotificationChannel    lateinit var notificationManager: NotificationManager    lateinit var builder: Notification.Builder    private val channelId = "12345" ... Read More

How to create a multilevel listView using Kotlin?

Azhar
Updated on 20-Apr-2020 12:56:15

355 Views

This example demonstrates how to create a multilevel listView using Kotlin Android.Step 1 − Create a new project in Android Studio, go to File ⇉ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. Step 3 − Add the following code to src/MainActivity.ktpackage app.com.kotlinapp import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import kotlinx.android.synthetic.main.activity_main.* class MainActivity : AppCompatActivity() {    private val header: MutableList = ArrayList()    private val body: MutableList = ArrayList()    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main)       val myFavCricketPlayers: ... Read More

How to listen for Webview loading a URL using Kotlin?

Azhar
Updated on 20-Apr-2020 12:39:51

1K+ Views

This example demonstrates how to listen for a webview finishing loading a URL in android.Step 1 − Create a new project in Android Studio, go to File ⇒New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.             Step 3 − Add the following code to src/MainActivity.ktpackage app.com.kotlinapp import android.os.Bundle import android.view.View import android.webkit.WebChromeClient import android.webkit.WebView import android.webkit.WebViewClient import android.widget.Button import android.widget.TextView import android.widget.Toast import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() {    private var webView: WebView? = null       private ... Read More

How to get all checked items in listView using Kotlin?

Azhar
Updated on 20-Apr-2020 12:28:14

763 Views

This example demonstrates how to get all checked items in listView using Kotlin.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.                             Step 3 − Create a java class (CustomAdapter.kt) and the following codepackage app.com.myapplication import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.BaseAdapter import android.widget.CheckBox import android.widget.TextView import android.widget.Toast class CustomAdapter(private val context: Context, private var modelArrayList: ArrayList) : ... Read More

How to listen for volume buttons in Android background service using kotlin?

Azhar
Updated on 20-Apr-2020 12:17:17

497 Views

This example demonstrates how to listen for volume buttons in Android background service using kotlin.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 - Add the following code to res/layout/activity_main.xml.     Step 3 − Add the following code to src/MainActivity.ktpackage app.com.kotlinapp import android.os.Bundle import android.os.Handler import android.provider.Settings import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() {    private lateinit var settingsContentObserver: SettingsContentObserver    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main)       settingsContentObserver ... Read More

How to play sound using SoundPool in Kotlin?

Azhar
Updated on 20-Apr-2020 12:11:54

2K+ Views

This example demonstrates how to play sound using SoundPool in Kotlin.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. Step 3 − Create a new Android Resource folder (raw) and copy-paste your sound file in the res/raw/filename.mp3 as shown below −Step 4 − Add the following code to src/MainActivity.ktpackage app.com.myapplication import android.media.AudioManager import android.media.SoundPool import android.os.Bundle import android.view.View import android.widget.Toast import androidx.appcompat.app.AppCompatActivity @Suppress("DEPRECATION") class MainActivity : AppCompatActivity() {    private var ... Read More

Difference between Facial Recognition and Face ID

Mahesh Parahar
Updated on 15-Apr-2020 08:29:34

863 Views

Facial RecognitionFacial recognition is a technique in which a person is identified using his/her face. The system captures the facial expression details, analyzes and compares with an existing database of known faces to find a match. The face detection process helps to locate people in images and videos.Face IDFace ID is an advanced face recognition technology first unveiled in iPhone X. Face ID is very reliable and advanced biometric technology used in iPhones.The following are some of the important differences between Facial Recognition and Face ID.Sr. No.KeyFacial RecognitionFace ID1DefinitionFacial Recognition is a software application that is capable of verifying a ... Read More

Difference between Substitution Cipher Technique and Transposition Cipher Technique

Kiran Kumar Panigrahi
Updated on 22-Aug-2022 14:30:07

16K+ Views

Both Substitution Cipher and Transposition Cipher are traditional techniques used in cryptography to encrypt a plaintext into ciphertext in order to prevent it from getting tampered. Read through this article to find out more about Substitution cipher and Transposition cipher and how they are different from each other.What is Substitution Cipher Technique?In the Substitution Cipher technique, each character is substituted with other character/number or other symbol. This technique changes the identity of a character but not its position in the string.A substitution cipher encrypts a text sequence by replacing letters or units of text with other letters or units of ... Read More

Advertisements