Azhar has Published 721 Articles

How to register a BroadcastReceiver programmatically in Android?

Azhar

Azhar

Updated on 01-Jul-2020 12:06:59

2K+ Views

This example demonstrates how do I register a BroadcastReceiver programtically 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 ... Read More

How to use snackbar in Android?

Azhar

Azhar

Updated on 01-Jul-2020 11:52:30

798 Views

This example demonstrates how do I use snackBar 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 ... Read More

How to get screen DPI programmatically in Android?

Azhar

Azhar

Updated on 01-Jul-2020 08:24:22

997 Views

This example demonstrates how do I get screen DPI programatically 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.         ... Read More

How to format date and time in android?

Azhar

Azhar

Updated on 01-Jul-2020 08:23:14

2K+ Views

This example demonstrates how do I format date and time 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 ... Read More

How to set the part of the Android TextView as clickable?

Azhar

Azhar

Updated on 01-Jul-2020 08:21:17

2K+ Views

This example demonstrates how do I set the part of the Android textView as clickable.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.   ... Read More

How to display toast messages from a thread in Android?

Azhar

Azhar

Updated on 01-Jul-2020 08:20:43

897 Views

This example demonstrates how do I display toast messages from 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. Step 3 ... Read More

How to programmatically turn on Wifi on Android device?

Azhar

Azhar

Updated on 01-Jul-2020 08:11:49

1K+ Views

This example demonstrates how do I programmatically turn on wifi in android device.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.       ... Read More

How to customize a button to set text and color in Android?

Azhar

Azhar

Updated on 01-Jul-2020 08:10:01

2K+ Views

This example demonstrates how do I customize a button to set text and color 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. ... Read More

How to set margin of ImageView using code in Android?

Azhar

Azhar

Updated on 01-Jul-2020 07:49:26

915 Views

This example demonstrates how do I set margin of ImageView using code 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.   ... Read More

How to lock screen orientation on all android devices programmatically?

Azhar

Azhar

Updated on 01-Jul-2020 07:48:49

1K+ Views

This example demonstrates how do I lock screen orientation on all android devices 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.   ... Read More

Advertisements