Image Slider Android

To slide one entire screen to another screen, the image slider is used in Android which is created by the ViewPager. The support library provides the ViewPager. The ViewPager class must be inherited to implement an image slider. It extends the PagerAdapter. Example of Image Slider: activity_main.xml: The ViewPager is wrapped inside the RelativeLayout, in … Read more

Horizontal ScrollView Android

The Horizontal ScrollView in Android is a FrameLayout which is used to scroll the child elements or views in a horizontal direction. The functionality of a horizontal scroll view in Android is facilitated by the android.widget.HorizontalScrollView class.As the name itself suggests, it only supports horizontal scrolling. Vertical ScrollView can be used in Android for vertical … Read more

Vertical ScrollView Android

To scroll the child elements of a pallet inside a ScrollView, the Android ScrollView is used whose functionality is provided by the android.widget.ScrollView class. The default scroll view in Android is a vertical scroll view. As the name itself suggests, it scrolls the elements vertically. Similarly, for horizontal ScrollView, the HorizontalScrollView is used in Android. … Read more

ProgressBar Android

To display the progress of work being done, the android progress bar dialog box can be displayed. It is mainly used to display the status of activities like downloading a file, analyzing the status of work, etc. The progress dialog for the dummy file download operation is demonstrated in the below example. Here, to show … Read more

Analog clock and Digital clock Android

To display an analog clock, Android provides the android.widget.AnalogClock class and to display a digital clock Android provides the android.widget.DigitalClock class. Any of these clocks can be used to show time in an Android application. The View class in Android has a subclass named Android AnalogClock, while the TextView class has a subclass named Android … Read more

TimePicker Android

To select the time by an hour and minute, the TimePicker widget is used in Android. But it does not allow us to select the time by seconds. The FrameLayout class has a subclass android.widget.TimePicker. The FrameLayout class also has a subclass android.widget.DatePicker. Android TimePicker Example: activity_main.xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" … Read more

DatePicker Android

To select dates by day, month, and year, the DatePicker widget is used in Android. The FrameLayout class has a subclass android.widget.DatePicker. The FrameLayout class also has a subclass android.widget.TimePicker, i.e, Android also facilitates us to select time using the TimePicker widget. Android DatePicker Example: activity_main.xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" … Read more

SeekBar Android

To display a ProgressBar with a draggable thumb, such that the end-user can drag the thumb left and right to move the progress of an activity, the SeekBar is used in Android. The methods to perform an event handling for seek bar is facilitated by the SeekBar.OnSeekBarChangeListener interface. The AbsSeekBar class has the Android SeekBar … Read more

RatingBar Android

To get the rating from the user, the RatingBar is used in Android which is a subclass of the AbsSeekBar class and returns a floating-point number such as 2.0, 3.5, 4.0, etc. The rating is displayed in stars by the Android RatingBar. The RatingBar class in Android have the getRating() method to return the rating … Read more

WebView Android

To display a web page in android loaded from the same application or URL, the WebView is used in Android. Thus, online content can be displayed in an Android activity using the Android WebView which displays a web page using the Webkit engine. In Android, the AbsoluteLayout class has a subclass android.webkit.WebView. To load and … Read more