Mobile Development Articles

Page 124 of 156

How to Add One Side Left Border to TextView in Android using XML?

Vrundesha Joshi
Vrundesha Joshi
Updated on 30-Jul-2019 1K+ Views

This example demonstrate about How to Add One Side Left Border to TextView in Android using XML.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 and linear layout. In Linear layout we have added background as text_style. So create a file called text_style.xml in drawable as shown below – ...

Read More

How to clear Singleton instance in android?

Vrundesha Joshi
Vrundesha Joshi
Updated on 30-Jul-2019 1K+ Views

Before getting into the example, we should know what singleton design pattern is. A singleton is a design pattern that restricts the instantiation of a class to only one instance. Notable uses include controlling concurrency and creating a central point of access for an application to access its data store.This example demonstrate about How to clear Singleton instance in androidStep 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 ...

Read More

How to refresh Singleton class every one hour in android?

Vrundesha Joshi
Vrundesha Joshi
Updated on 30-Jul-2019 401 Views

Before getting into example, we should know what singleton design patter is. A singleton is a design pattern that restricts the instantiation of a class to only one instance. Notable uses include controlling concurrency, and creating a central point of access for an application to access its data store.This example demonstrate about How to refresh Singleton class every one hour in androidStep 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 ...

Read More

How to store Hashmap in Singleton in android?

Jennifer Nicholas
Jennifer Nicholas
Updated on 30-Jul-2019 381 Views

Before getting into an example, we should know what singleton design pattern is. A singleton is a design pattern that restricts the instantiation of a class to only one instance. Notable uses include controlling concurrency and creating a central point of access for an application to access its data store.This example demonstrates How to store Hashmap in Singleton in androidStep 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 Singleton with Global Context in android?

Nitya Raut
Nitya Raut
Updated on 30-Jul-2019 915 Views

Before getting into example, we should know what singleton design patter is. A singleton is a design pattern that restricts the instantiation of a class to only one instance. Notable uses include controlling concurrency, and creating a central point of access for an application to access its data store.This example demonstrates How to use Singleton with Global Context in androidStep 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."1.0" encoding>"utf-8"?> "http://schemas.android.com/apk/res/android"    xmlns:tools>"http://schemas.android.com/tools"    android:layout_width>"match_parent"   ...

Read More

How to use Android Media Player Singleton?

Jennifer Nicholas
Jennifer Nicholas
Updated on 30-Jul-2019 515 Views

Before getting into an example, we should know what singleton design pattern is.  A singleton is a design pattern that restricts the instantiation of a class to only one instance. Notable uses include controlling concurrency and creating a central point of access for an application to access its data store.This example demonstrates How to use Android Media Player SingletonStep 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, ...

Read More

How to use Android TEXT TO SPEAK from Singleton?

Vrundesha Joshi
Vrundesha Joshi
Updated on 30-Jul-2019 233 Views

Before getting into example, we should know what singleton design pattern is.  A singleton is a design pattern that restricts the instantiation of a class to only one instance. Notable uses include controlling concurrency, and creating a central point of access for an application to access its data store.This example demonstrates How to use Android TEXT TO SPEAK from SingletonStep 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 read an image file in internal storage in android?

Nitya Raut
Nitya Raut
Updated on 30-Jul-2019 4K+ Views

This example demonstrates How to read an image file in internal storage 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 a button and image view. When user click on button, it will take an image from internal storage and append to image view.Step 3 − Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.content.Context; import android.content.ContextWrapper; import android.graphics.drawable.Drawable; import android.os.Bundle; ...

Read More

How to write an image file in internal storage in android?

Vrundesha Joshi
Vrundesha Joshi
Updated on 30-Jul-2019 6K+ Views

This example demonstrates How to write an image file in internal storage 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 a button. When user click on button, It will store data in internal storage.Step 3 − Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.content.Context; import android.content.ContextWrapper; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.Button; import ...

Read More

How to use vector class in Android listview?

Jennifer Nicholas
Jennifer Nicholas
Updated on 30-Jul-2019 323 Views

This example demonstrate about How to use vector class in Android listviewStep 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 the name and record number as Edit text, when user clicks on save button it will store the data into ArrayList. Click on ...

Read More
Showing 1231–1240 of 1,551 articles
« Prev 1 122 123 124 125 126 156 Next »
Advertisements