Found 1631 Articles for Android

How to use thread.getName() and thread.setName() in android?

Nishtha Thakur
Updated on 29-Jun-2020 14:58:25

230 Views

Before getting into example, we should know what thread is. A thread is a lightweight sub-process, it going to do back ground operations without interrupt to ui. This example demonstrate about How to use thread.getName() and thread.setName() 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.             In the above code, we have taken edit text and text view. When user enter some text into edit text, it ... Read More

How to use set the priority for a thread in android?

Anvi Jain
Updated on 29-Jun-2020 14:57:41

588 Views

Before getting into an example, we should know what thread is. A thread is a lightweight sub-process, it going to do background operations without interrupt to ui. This example demonstrate about How to use set the priority for a thread 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.             In the above code, we have taken edittext and textview. When user enter some text into edittext, it ... Read More

How to use multiple threads in android?

Smita Kapse
Updated on 29-Jun-2020 14:57:05

3K+ Views

Before getting into an example, we should know what thread is. A thread is a lightweight sub-process, it going to do background operations without interrupt to ui. This example demonstrate about How to use multiple threads 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.                 In the above code, we have taken edittext and textview. When user enter some text into edittext, it going to ... Read More

How to use thread.sleep() in android?

Nishtha Thakur
Updated on 29-Jun-2020 14:56:28

4K+ Views

Before getting into an example, we should know what thread is. A thread is a lightweight sub-process, it going to do background operations without interrupt to ui. This example demonstrate about How to use thread.sleep() 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.             In the above code, we have taken edittext and textview. When user enter some text into edittext, it going to wait till 5000ms ... Read More

How to create a thread in android?

Anvi Jain
Updated on 29-Jun-2020 14:55:50

5K+ Views

Before getting into an example, we should know what thread is. A thread is a lightweight sub-process, it going to do background operations without interrupt to ui. This example demonstrate about How to create a thread 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.             In the above code, we have taken edittext and textview. When user enter some text into edittext, it going to wait till ... Read More

How to avoid thread start twice in android?

Smita Kapse
Updated on 29-Jun-2020 14:36:41

438 Views

Before getting into an example, we should know what thread is. A thread is a lightweight sub-process, it going to do background operations without interrupt to ui. This example demonstrate about How to avoid thread start twice 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.             In the above code, we have taken edittext and textview. When user enter some text into edittext, it going to wait ... Read More

How to use string Builder class in android?

Nishtha Thakur
Updated on 29-Jun-2020 13:51:54

1K+ Views

Before getting into an example, we should know what string builder is. StringBuilder class is used to create a mutable string and it is not thread safe so multiple thread can access string builder class at a time. This example demonstrate about How to use string Builder class 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.                             In the ... Read More

How to use string buffer in android?

Anvi Jain
Updated on 29-Jun-2020 13:51:26

676 Views

Before getting into example, we should know what string buffer is. StringBuffer class is used to create mutable string and it is thread safe. This example demonstrate about How to use string buffer 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.                             In the above code, we have taken edittext, button and textviews. When user click on button, it ... Read More

How to use compare string in android?

Nishtha Thakur
Updated on 29-Jun-2020 13:48:03

2K+ Views

This example demonstrate about How to use compare string 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.                     In the above code, we have taken edittext, button and textviews. When user click on button, it will take the data from edittext and manipulate with string with string comparing techniques. The result of manipulation data append to textview’sStep 3 − Add the following code ... Read More

How to get thread group information in android?

Anvi Jain
Updated on 29-Jun-2020 13:47:36

191 Views

Before getting into an example, we should know what thread is. A thread is a lightweight sub-process, it going to do background operations without interrupt to ui. This example demonstrate about How to get thread group information 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.     In the above code, we have taken textview. It contains information about current thread group information.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; ... Read More

Advertisements