Found 1966 Articles for Apps/Applications

How to Check available space on Android devices using Kotlin?

Azhar
Updated on 18-Aug-2020 09:06:14

613 Views

This example demonstrates how to Check available space on Android devices 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.ktimport android.os.Bundle import android.os.Environment import android.os.StatFs import android.text.format.Formatter import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import java.io.File class MainActivity : AppCompatActivity() {    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main)       title = "KotlinApp"     ... Read More

How to pass drawables between activities in Android using Kotlin?

Azhar
Updated on 18-Aug-2020 09:03:20

253 Views

This example demonstrates how to pass drawables between activities in Android 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.ktimport android.content.Intent import android.os.Bundle import android.widget.Button import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() {    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main)       title = "KotlinApp"       val button: Button = findViewById(R.id.button) ... Read More

How to send an email with a file attachment in Android using Kotlin?

Azhar
Updated on 18-Aug-2020 09:00:11

1K+ Views

This example demonstrates how to send an email with a file attachment in Android 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.ktimport android.content.Intent import android.net.Uri import android.os.Bundle import android.view.View import android.widget.Button import android.widget.EditText import android.widget.TextView import android.widget.Toast import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() {    lateinit var ... Read More

How to change the Android Overflow menu icon programmatically using Kotlin?

Azhar
Updated on 18-Aug-2020 08:55:55

651 Views

This example demonstrates how to change the Android Overflow menu icon programmatically.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.ktimport android.graphics.Color import android.os.Bundle import android.view.Menu import android.view.MenuItem import android.widget.Toast import androidx.appcompat.widget.Toolbar import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() {    lateinit var toolBar: Toolbar    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main)       title = "KotlinApp" ... Read More

How to convert ISO 8601 String to Date/Time object in Android using Kotlin?

Azhar
Updated on 21-Jul-2020 13:57:04

2K+ Views

This example demonstrates how to convert an ISO 8601 String to Date/Time object in Android 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.Example Step 3 − Add the following code to src/MainActivity.ktimport android.os.Bundle import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import java.text.SimpleDateFormat import java.util.* class MainActivity : AppCompatActivity() {    lateinit var textView: TextView    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main)       title = "KotlinApp" ... Read More

How to change the color and font of Android ListView using Kotlin?

Azhar
Updated on 21-Jul-2020 13:53:35

633 Views

This example demonstrates how to change the color and font of Android 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.Example Step 3 − Add the following code to src/MainActivity.ktimport android.os.Bundle import android.widget.ArrayAdapter import android.widget.ListView import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() {    var operatingSystem: Array = arrayOf("Android", "IPhone", "WindowsMobile", "Blackberry", "WebOS", "Ubuntu", "Windows7", "Max OS X")    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main)   ... Read More

How to change the background color of ListView items on Android using Kotlin?

Azhar
Updated on 21-Jul-2020 13:50:02

393 Views

This example demonstrates how to change the background color of ListView items on 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.Example Step 3 − Add the following code to src/MainActivity.ktimport android.os.Build import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.widget.ArrayAdapter import android.widget.ListView class MainActivity : AppCompatActivity() {    var operatingSystem: Array = arrayOf("Android", "IPhone", "WindowsMobile", "Blackberry", "WebOS", "Ubuntu", "Windows7", "Max OS X")    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main) ... Read More

How to find the currently running applications programmatically in Android using Kotlin?

Azhar
Updated on 21-Jul-2020 13:45:58

586 Views

This example demonstrates how to find the currently running applications programmatically in Android 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.Example Step 3 − Add the following code to src/MainActivity.ktimport android.app.ActivityManager import android.app.ActivityManager.RunningTaskInfo import android.content.Context import android.os.Bundle import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import java.util.* class MainActivity : AppCompatActivity() {    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main)       title = "KotlinApp"       val ... Read More

How do I remove lines between ListViews on Android using Kotlin?

Azhar
Updated on 21-Jul-2020 13:42:16

122 Views

This example demonstrates how to remove lines between ListViews on Android 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.Example Step 3 − Add the following code to src/MainActivity.ktimport android.os.Bundle import android.widget.ArrayAdapter import android.widget.ListView import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() {    lateinit var listView: ListView    var mobilePhones = arrayOf("Samsung", "Iphone", "Nokia", "Alcatel", "Blackberry", "Oppo", "Sony")    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main)     ... Read More

How to copy text programmatically (Ctrl+C) in my Android app using Kotlin?

Azhar
Updated on 21-Jul-2020 13:38:36

322 Views

This example demonstrates how to copy text programmatically (Ctrl+C) in my Android app 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.Example Step 3 − Add the following code to src/MainActivity.ktimport android.content.ClipData import android.content.ClipboardManager import android.content.Context import android.os.Bundle import android.view.View import android.widget.EditText import android.widget.TextView import android.widget.Toast import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() {    lateinit var editText: EditText    lateinit var textView: TextView    lateinit var clipboardManager: ClipboardManager   ... Read More

Advertisements