Found 2041 Articles for Mobile Development

How to make Two activities with different colored status bar in Android.

Arjun Thakur
Updated on 30-Jul-2019 22:30:24

479 Views

There are so many situations, where we need to change the different action bar colors according toproject requirement . This example demonstrate about how to make Two activities with different colored status bar.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 created on button when you click on button it going to call second activity.Step 3 − Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import ... Read More

How to implement Android TextInputLayout

Chandu yadav
Updated on 30-Jul-2019 22:30:24

2K+ Views

Before getting into example, we should know what is TextInputLayout in android. TextInputLayout is extended by Linear Layout. It going to act as a wrapper for edit text and shows flatting hint animation for edit text.This example demonstrate about how to implement Android TextInputLayout.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 ... Read More

How to get the absolute coordinates of a view in Android?

George John
Updated on 30-Jul-2019 22:30:24

4K+ Views

Before getting into example, we should know what is absolute coordinates. It means absolute position (x, y)of a view on window manager. This example demonstrate about how to get the absolute coordinates of a view.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 xml, we have given one Textview. when user click on textview, it will show the position of the view on Toast.Step 3 − Add the following ... Read More

How to disable landscape mode in Android?

Ankith Reddy
Updated on 30-Jul-2019 22:30:24

2K+ Views

Android supports two orientations as portrait and landscape. we can disable orientation in android application. This example demonstrate about how to disable landscape mode 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, it contains linear layout and editext. it going to support both landscape and portrait as shown below -The above output indicates about landscape modeThe above output indicates about portrait mode.To disable landscape mode need ... Read More

How to integrate Android Speech To Text?

Arjun Thakur
Updated on 30-Jul-2019 22:30:24

2K+ Views

Android supports Google inbuilt text to speak API using RecognizerIntent.ACTION_RECOGNIZE_SPEECH. In this example demonstrate about how to integrate Android speech to text.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 this above code we have created one text view and image view. When user click on image view, it will call Google speech to text API and added text to text ... Read More

How to implement Android Pull-to-Refresh?

Chandu yadav
Updated on 30-Jul-2019 22:30:24

431 Views

Before getting into example, we should know what is Pull to refresh layout in android . we can call pull to refresh in android as swipe-to-refresh. when you swipe screen from top to bottom it will do some action based on setOnRefreshListener.This example demonstrate about how to implement android pull to refresh.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 given swipeRefreshLayout as parent ... Read More

How to create Animated Gradient Background in android.

George John
Updated on 30-Jul-2019 22:30:24

677 Views

Before getting into example, we should know what is Gradient color. According to Wikipedia, In computer graphics, a color gradient (sometimes called a color ramp or color progression) specifies a range of position-dependent colors, usually used to fill a region. For example, many window managers allow the screen background to be specified as a gradient.This example demonstrate about how to create Animated Gradient Background 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 update RecyclerView Adapter Data in Android?

Ankith Reddy
Updated on 30-Jul-2019 22:30:24

5K+ Views

Before getting into example, we should know what is Recycler view in android. Recycler view is more advanced version of list view and it works based on View holder design pattern. Using recycler view we can show grids and list of items.This example demonstrate about how to update Recycler View adapter by creating a beautiful student records app that displays student name with age.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 − Open build.gradle and add Recycler view & Card view ... Read More

How to Scroll top in RecyclerView with LinearLayoutManager in Android?

Arjun Thakur
Updated on 30-Jul-2019 22:30:24

2K+ Views

Before getting into example, we should know what is Recycler view in android. Recycler view is more advanced version of list view and it works based on View holder design pattern. Using recycler view we can show grids and list of items .This example demonstrate about how to Scroll top in RecyclerView with LinearLayoutManager by creating a beautiful student records app that displays student name with age .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 − Open build.gradle and add Recycler ... Read More

How to build a Horizontal ListView with RecyclerView in Android?

Chandu yadav
Updated on 30-Jul-2019 22:30:24

1K+ Views

Before getting into example, we should know what is Recycler view in android. Recycler view is more advanced version of list view and it works based on View holder design pattern. Using recycler view we can show grids and list of items.This example demonstrate about how to build a horizontal list view with Recycler View by creating a beautiful student records app that displays student name with age.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 − Open build.gradle and add Recycler ... Read More

Advertisements