Hi everyone,

I am sharing AC_NativeDialogs, a lightweight .b4xlib designed to bring a seamless and professional Android native experience to your B4A projects. This library wraps the official Android DatePicker, TimePicker, and AlertDialog components using JavaObject.

Why use this library?
  • Native Experience: Uses the standard system components that users already know.
  • Lightweight: No extra layouts or resources needed.
  • Open Source: As it is a .b4xlib, you can unzip it to study, modify, or improve the classes.

1. AC_NativeSelectionDialog (CustomSelect)​

Handles single or multi-choice lists using native RadioButtons and Checkboxes.

Screenshot_20260312_204633.jpg



AC_Select:
' Usage Example:
Dim AC_Select1 As AC_NativeSelectionDialog
AC_Select1.Initialize(Me, "AC_Select1")

Dim Options() As String = Array As String("Java", "B4X", "Python", "C#")
AC_Select1.Show("Select Languages", Options, Null, True) ' True for Multi-selection

Sub AC_Select1_SelectionComplete (Items() As String, Checked() As Boolean)
For i = 0 To Checked.Length - 1
If Checked(i) Then Log("Selected: " & Items(i))
Next
End Sub


2. AC_DatePicker​

A clean calendar picker. You can restrict the selection range by setting minimum and maximum dates.

Screenshot_20260312_204621.jpg


AC_DatePicker:
' Usage Example:
Dim AC_DatePicker1 As AC_DatePicker
AC_DatePicker1.Initialize(Me, "AC_DatePicker1")

' Set limits using Strings
AC_DatePicker1.SetMinDate("09/03/2026")
AC_DatePicker1.SetMaxDate("19/03/2026")

AC_DatePicker1.Show(DateTime.Now)

Sub AC_DatePicker1_DateSelected (Day As Int, Month As Int, Year As Int)
Log($"Date selected: ${Day}/${Month}/${Year}"$)
End Sub



3. AC_TimePicker​

The standard Android clock selector. Supports both 24h and 12h formats.

Screenshot_20260312_204626.jpg


AC_TimePicker:
' Usage Example:
Dim AC_TimePicker1 As AC_TimePicker
AC_TimePicker1.Initialize(Me, "AC_TimePicker1")
AC_TimePicker1.Show(DateTime.Now, True) ' True for 24h format

Sub AC_TimePicker1_OkClicked (Hour As Int, Minute As Int)
Log($"Confirmed time: ${Hour}:${Minute}"$)
End Sub

Sub AC_TimePicker1_CancelClicked
Log("Time selection cancelled")
End Sub


Installation & Requirements​

  • Library: Download and copy AC_NativeDialogs.b4xlib to your Additional Libraries folder.
  • Dependencies: JavaObject, XUI, DateUtils.
  • Sample: I have attached a sample project (NativeDialogs_Example.zip) showing all features.

Support​

If this library is useful to you and you'd like to support my work, feel free to buy me a coffee!
PayPal: yusrahassamo@gmail.com

Author: abdullcadre
Version: 1.00 (2026)
 

Attachments

  • Example_ACNativeDialogs.zip
    31 KB · Views: 9
  • AC_NativeDialogs.b4xlib
    5.9 KB · Views: 9
Top