Android Widgets - Overview

Progress Bar

  • Part of Android UI Kit, which includes built-in UI components and tools provided by the Android SDK.
  • Used to indicate the progress of an operation.
  • Two Modes:
    • Determinate: Displays the remaining percentage and completed work.
    • Indeterminate (Default): Cyclic animation when the operation duration is unknown.

Seek Bar



  • Extends Progress Bar.
  • Common use cases: Adjusting volume, brightness for media playing, setting a price range etc
  • Allows users to drag a thumbnail to adjust progress.
  • Customizable with min, max, and step values.

Date and Time Picker Dialogs

  • Enables users to select a date or time.
  • Two main types:
    • DatePickerDialog – Allows users to select a date.
    • TimePickerDialog – Allows users to select a time.

Calendar View

  • Displays a calendar interface for selecting dates.
  • Configurable date range (defined in XML or code).
  • Introduced in API 11.
  • Functions similarly to Date and Time Picker, but Date and Time Picker is more versatile.


WebView

  • Allows displaying web content within an app without using Android’s native views.
  • Supports HTTP and HTTPS.
  • JavaScript is disabled by default (but can be enabled).
  • Developers can:
    • Show a loading indicator while a page loads.
    • Customize error handling and override link click behavior.

Rating Bar

  • Extension of SeekBar and ProgressBar.
  • Displays a star-based rating system.
  • Returns a floating-point number representing the rating.

VideoView

  • Used for playing video files.
  • Can be integrated with SessionPlayer or MediaController.
  • setVideoURI is method to set source
  • Start/Stop Video (start()pause()stopPlayback())

TextureView

  • Used for displaying a content stream.
  • Typically used for videos and camera previews
  • Can be customized - rotated scaled
  • TextureView does not handle media playback by itself; instead, it requires a content source, such as a MediaPlayer, Camera, OpenGL, or a custom renderer.
  • To display a video, you can use MediaPlayer with SurfaceTexture

 


Comments

Popular posts from this blog

Maps - Overview

Android UI - Review Questions