Found 2041 Articles for Mobile Development

How to set random background for Recyclerview in Android?

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

3K+ Views

Before getting into set random background color for recycler view example, we should know what is Recycler view in android. Recycler view is a more advanced version of the list view and it works based on View holder design pattern. Using recycler view we can show grids and list of items.This example demonstrates How to set the random background for Recyclerview 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 ... Read More

Android Working with Recycler View

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

1K+ Views

Recycler view is a more advanced version of listview and works based on View holder design pattern. Using recyclerview we can show grids as well as a list of items.This example demonstrates how to integrate RecyclerView 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 library dependency.apply plugin: 'com.android.application' android {    compileSdkVersion 28    defaultConfig {       applicationId "com.example.andy.tutorialspoint"   ... Read More

How to use Android ViewPager?

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

2K+ Views

Before getting into the example, we should know what is view pager in android. View pager found in Support Library in Android, using view pager we can switch the fragments.This example demonstrates how to use android view pager.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 in build.gradle.apply plugin: 'com.android.application' android {    compileSdkVersion 28    defaultConfig {       applicationId "com.example.andy.myapplication"       minSdkVersion 19       targetSdkVersion 28       versionCode ... Read More

How to change package name in android?

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

204 Views

Here are the simple steps to change the package name in android .Click on your pack name(in source tree). -> Right Click --> Refractor -> Rename as shown below -Click on rename, it will show pop up as shown below -Click on Rename package, it will show new pop up as shown below -Now change the name as per requirement and click on refractor as shown below -Now it will check all files and asks for refractor as shown below -In the below of Android studio, there is "do Refractor button". click on it. Now open your build.gradle as shown ... Read More

How does Constraint Layout works in android?

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

854 Views

In simple words, constraint layout is an advanced version of a Relative layout. It is used to reduce the child view hierarchies and improve the performance.Properties of constraint layout as shown below -Wrap Content –It wrap the view size according to data. Any Size – This is very similar to match parent. Fixed Size – This allows standard height and width(fixed sizes). In the above example we have shown the button with all properties, now look into code level as shown below -In the above, we have declare layout margin-top, bottom, start and end. those are the standard distance (Similar ... Read More

How to use RatingBar in android?

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

2K+ Views

Before getting into an example, we should know what is rating bar in android. Rating bar is a subclass of absSeekbar class in android. It is used to show the rating on view Group or window manager.This example demonstrates how to use the rating bar 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 declared Rating bar and set numStars as 5 means ... Read More

How to share app data with other applications in android?

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

979 Views

In android using implicit intent, we can send data with other applications using ACTION_SEND action. We have to call Intent.createChooser() to open default chooser of android mobile to send the data. it may same or different in Android mobiles.This example demonstrates how to share app data with other applications 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 textview, when user clicks on text view ... Read More

How to make a countdown timer in Android?

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

3K+ Views

Before getting into an example, we should know what is a countdown timer in android. Count down timer as simple as we see in watches and mobile phones. we can set count down time after completion of time it will stop and get 0 values.There are four methods are available to use countdown timer as shown below -onTick(long millisUntilFinished ) - In this method we have to pass countdown mill seconds after done countdown it will stop Ticking.onFinish() - After finish ticking, if you want to call any methods or callbacks we can do in onFinish().start() - It is used ... Read More

How to use View Stub in android?

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

442 Views

Before getting into example, we should know what is view stub in android. It is a zero-sized lazy inflate view. it going to inflate at runtime. Using inflate() method, it going to inflate at runtime and append to window manager or view group. using setVisibility(int). we can show and hide view stub in android.This example demonstrates how to use view stub 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 implement HorizontalScrollView like Gallery in Android?

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

3K+ Views

Before getting into an example, we should know what is Horizontal Scroll View. Horizontal Scrollview provides by android.widget.HorizontalScrollView class. It is used to scroll child views in a horizontal direction.This example demonstrates how to use horizontal Scroll 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.                                                       ... Read More

Advertisements