Apps/Applications Articles

Page 30 of 148

How to create scrollable TextView on Android using Kotlin?

Azhar
Azhar
Updated on 30-Nov-2020 2K+ Views

This example demonstrates how to create scrollable TextView 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.     Step 3 − Add the following code to src/MainActivity.ktimport androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.text.method.ScrollingMovementMethod import android.widget.TextView class MainActivity : AppCompatActivity() {    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main)       title = "KotlinApp"       val textView: TextView = findViewById(R.id.textView)   ...

Read More

Custom Progress Bar in Android using Kotlin.

Azhar
Azhar
Updated on 28-Nov-2020 2K+ Views

This example demonstrates how to create a custom Progress Bar 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 androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.widget.ProgressBar class MainActivity : AppCompatActivity() {    lateinit var progressBar:ProgressBar    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main)       title = "KotlinApp"       progressBar = ...

Read More

How to check internet connection availability and the network type on Android using Kotlin?

Azhar
Azhar
Updated on 28-Nov-2020 1K+ Views

This example demonstrates how to check internet connection availability and the network type 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.         Step 3 − Add the following code to src/MainActivity.ktimport android.content.Context import android.net.ConnectivityManager import android.os.Bundle import android.widget.TextView import android.widget.Toast import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() {    lateinit var textView: TextView    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main)   ...

Read More

How to write a custom adapter for my list view on Android using Kotlin?

Azhar
Azhar
Updated on 28-Nov-2020 6K+ Views

This example demonstrates how to write a custom adapter for my list view 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.     Step 3 − Add the following code to src/MainActivity.ktimport android.content.Context import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.BaseAdapter import android.widget.ListView import android.widget.TextView import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() {    lateinit var listView: ListView    var arrayList: ArrayList = ArrayList()    var adapter: MyAdapter? = ...

Read More

How to show current progress while downloading a file on Android App using Kotlin?

Azhar
Azhar
Updated on 28-Nov-2020 634 Views

This example demonstrates how to show current progress while downloading a file on 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.         Step 3 − Add the following code to src/MainActivity.ktimport android.os.Bundle import android.view.View import android.webkit.WebView import android.widget.ProgressBar import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() {    lateinit var webView: WebView    lateinit var progressBar: ProgressBar    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)     ...

Read More

How to create EditText accepts Alphabets only in Kotlin?

Azhar
Azhar
Updated on 05-Nov-2020 310 Views

This example demonstrates how to create EditText accepts Alphabets only 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 − Add the following code to src/MainActivity.kt        

Read More

How to add a TextView to a LinearLayout dynamically in Android using Kotlin?

Azhar
Azhar
Updated on 05-Nov-2020 2K+ Views

This example demonstrates how to add a TextView to a LinearLayout dynamically 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.graphics.Color import android.os.Bundle import android.widget.LinearLayout import android.widget.TextView import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() {    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main)       title = "KotlinAp"       val linearLayout: LinearLayout = ...

Read More

Web Scraping in Android Application using Kotlin?

Azhar
Azhar
Updated on 05-Nov-2020 2K+ Views

This example demonstrates how to perform Web Scraping in Android Application 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.AsyncTask import android.os.Bundle import android.widget.Button import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import org.jsoup.Jsoup import java.io.IOException @Suppress("DEPRECATION") class MainActivity : AppCompatActivity() {    private lateinit var textView: TextView    lateinit var button: Button    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState) ...

Read More

How to create custom Alert Dialogs in an Android App using Kotlin?

Azhar
Azhar
Updated on 05-Nov-2020 2K+ Views

This example demonstrates how to create custom Alert Dialogs in an 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.         Step 3 − Add the following code to src/MainActivity.ktimport android.app.Dialog import android.content.Context import android.os.Bundle import android.view.View import android.widget.Button import android.widget.Toast import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() {    private val context: Context = this    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       ...

Read More

How to use XMLPullParser to parse XML in Android using Kotlin?

Azhar
Azhar
Updated on 05-Nov-2020 1K+ Views

This example demonstrates how to use XMLPullParser to parse XML 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 − Create a Layout resource file (row.xml) and add the following code −             Step 5 − Create a new asset folder, and inside the asset folder create a Android resource file (model.xml) and add the following code −   ...

Read More
Showing 291–300 of 1,475 articles
« Prev 1 28 29 30 31 32 148 Next »
Advertisements