Tutorials & Examples

Android development starts here. Please do not post questions in this sub-forum.

Load HTML files from DirInternal to a WebView with UltimateWebView2 and WebViewAssetLoader

I would like to contribute to the never-ending question of how to load local HTML files into a WebView. The reason are the following recently asked questions (here and here by...
 

Attachments

  • UltimateWebView2ExampleFileAccess.zip
    27.5 KB · Views: 353

[B4X] AS Settings - Custom Property


With this property you can add your own view or layout

IMG_0540.jpg


In the following example, I add a B4XImageView to...
 

Attachments

  • AS Settings CustomProperty Example.zip
    351.1 KB · Views: 278

[B4X] AS AutoComplete - Custom Datasource and Icons


In this example I will show you how you can use your own data source and also display...
 

Attachments

  • AS_AutoComplete Manual mode Example.zip
    201.1 KB · Views: 323

[B4X] Firebase Push Notifications 2023+

Google has deprecated the previous method of sending push notifications. It will stop working on June 2024.
If you have an already working solution then you only need to update the B4J side. Do...
 

Attachments

  • B4J-SendingTool.zip
    1.8 KB · Views: 1,646
  • PushClients.zip
    16.8 KB · Views: 655
Last edited:

[B4XPages] Single page with no action bar and other pages with action bar

This is an example of how to make one of the pages show without the action bar while the others do show it.

Note that usage of IME in the main activity, to find the action bar height.

In each of...
 

Attachments

  • DynamicActionBar.zip
    16.3 KB · Views: 308

Camera2 - Still images and videos

Camera2 library is based on the Camera2 API introduced in Android 5 (API 21).
It is designed to work together with CamEx2 class.
It is supported by B4A v7.3+. The library will be included as...
 

Attachments

  • CamEx2.zip
    22.5 KB · Views: 638
Last edited:

[B4X] Simple function to highlight searchword in texts in CSBuilder Format

This simple function highlights all occurrences of a search term in a given text and returns the result as a CSBuilder.
The output can then be used for labels or MsgBox text.

B4X:
 Sub...
 

Attachments

  • Highlight2CsBuilder.zip
    10.1 KB · Views: 272

CREATE, UPDATE, DELETE AND CONSULT REGISTERS ON GOOGLE SHEET FROM YOUR APPLICATIONS

Searching the internet I found a service that allows you to convert any google sheet into a json api, it has a free version that allows you to consult and add data, connecting to the api is quite...
 

کانال تلگرام اختصاصی رفع خطاهای زبان فارسی Exclusive Telegram Channel for Persian Language Error Correction

If @Erel permits me, I will introduce my Telegram channel for error correction and provide examples specifically for the Persian language.
I am gathering all sorts of errors and putting them...
 

[B4X] AS FeatureRequest - Approved and implemented requests


In this example I show how easy you can display 2 pages, with the features that are under development and...
 

Attachments

  • AS_FeatureRequest Supabase Approved and implemented requests Example.zip
    181.8 KB · Views: 313
Last edited:

CustomFloatingMenuButton - B4A Library source code

The attached code shows how to create a Floating Menu Button, you can show the button by clicking on a button or a swipe gesture (right edge of the screen).

This is a guide that hopefully will...
 

Attachments

  • CustomFMB.apk
    277.8 KB · Views: 1,129
  • CustomFloatingMenuButton_SourceCode.zip
    15.4 KB · Views: 1,862
Last edited:

Conversion of B4A to B4XPages

Introduction

The conversion of the first of my B4A Apps to the newer B4XPages structure was not trivial and involved over 20 hours of research, overcoming misunderstandings, and finding...
 

Attachments

  • Section 1-2.pdf
    469.4 KB · Views: 1,223
  • Section 3 Step 12.pdf
    488.1 KB · Views: 976
  • Section 3 Step 1-11.pdf
    501.9 KB · Views: 1,106
  • Section 3 Step 13.pdf
    456.3 KB · Views: 1,109
  • Section 3 Step 14.pdf
    450.6 KB · Views: 951
  • Section 3 Step 15-16.pdf
    457.5 KB · Views: 1,054
  • Section 4-5.pdf
    393.4 KB · Views: 919

[B4X] AS FeatureRequest - Supabase as backend


In this example I show you how to use supabase as a backend for the AS_FeatureRequest quickly and easily...
 

Attachments

  • AS_FeatureRequest Supabase Example.zip
    179 KB · Views: 285
Last edited:

Using Camera2 with Zxing for live scan of 1D and 2D barcodes

I have used @Erel's sample project from here:


Have added a timer to get the preview bitmap every...
 

Attachments

  • core-3.3.2.zip
    493.6 KB · Views: 1,550
  • Camera2.zip
    16.5 KB · Views: 1,525
Last edited:

Android 14 / targetSdkVersion 34 and Services

B4A v13.0+ should be used with targetSdkVersion 34+.

Android 14 continues the longtime trend of making services less flexible and more difficult to use (converging to iOS background tasks...
 
Last edited:

[B4X] AS BottomActionSheet - Small Icon


In this example I will show you how you can add a small icon to an item and customize it to your needs.

A...
 

[B4A] Extended example of ContactsUtils to place shortcuts to contacts on the home screen

For some time now, it has not been possible to place short links to contacts on the home screen via the Contact Apps. Instead, the selected contact is always placed as a widget. However, since I...
 

Attachments

  • contact linking.zip
    10.6 KB · Views: 333

[B4X] AS Settings - ColorChooser Property


This setting allows users to select a color. For example, to change the main app color, which is a premium feature in...
 

Attachments

  • AS Settings ColorChooser Example.zip
    179.2 KB · Views: 314
Last edited:

TessBaseAPI ocr

hello, a small library of TessBaseAPI "tesseract4android-2.1.0" Ocr, you need to download tesseract4android-2.1.0.aar and junit-4.4.jar as Depends, for the tessdata languages...
 

Attachments

  • tess4.1.zip
    24 KB · Views: 911

Android Live Wallpaper tutorial

The user can set live wallpapers by long pressing on the home screen and choosing Wallpapers - Live Wallpapers.
Creating a live wallpaper is not too difficult.
A service is responsible for...
 

Attachments

  • WallpaperExample.zip
    18 KB · Views: 394
  • LiveWallpaper.zip
    8.9 KB · Views: 395
Last edited:
Top