Tutorials & Examples

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

[B4X] Documentation Booklets

The B4X documentation booklets are available in PDF format, Download Link.
All files are included in the zip file in the link above, pdf booklets and all the source code.

You can also...
Last edited:

[B4X] Features that Erel recommends to avoid

Many things have changed in B4X and also in the underlying platforms. I will try to list here all kinds of (old) features that have better alternatives.
B4X is backward compatible so these...
Last edited:

[B4X] "Code Smells" - common mistakes and other tips

"Code smells" are common patterns that can indicate that there is a problem in the code. A problem doesn't mean that the code doesn't work, it might be that it will be difficult to maintain it or...
Last edited:

[B4X] MQTT Chat Room


  • Chat_B4i.zip
    6.1 KB · Views: 1,930
  • Chat_B4J.zip
    3.8 KB · Views: 3,086
  • Chat_B4A.zip
    11.3 KB · Views: 2,088
Last edited:

[B4XPages] Bluetooth Chat Example


Updated implementation, based on B4XPages of https://www.b4x.com/android/forum/threads/android-bluetooth-bluetoothadmin-tutorial.14768/#content.

The code is much simpler...


  • BluetoothChat.zip
    18 KB · Views: 927
Last edited:

B4Xgoodies_from_walt61 Online


As JamesGreaves requested,
"So do you not think it would be of value to have even something like @walt61 has created but online?"...
Last edited:

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...


  • CamEx2.zip
    22.4 KB · Views: 31
Last edited:

B4X Object Browser - new thread

Hi. Please place any new questions or comments about the B4X Browser here.

Backup/Restore SQLite Database

This is an example of how to back up and restore the SQL Lite database as the database produces three files with three extensions
with the following extensions 'db.db'...


  • backup.restore.sqlite.zip
    17.7 KB · Views: 36

my share creation simple carousell

For the First I said Thank Too Much For Great Mr.Errel That my Inspirator, StarDust and All Of member that i can't say person by person, i wish yours appologize of my bad english, this my first...
Last edited:

[B4XPages] Admob Example

Check this other excellent example from @Jack Cole.

To help the new members to make money with B4A, I tried to compile all the relevant Admob code (except mediation) of the...


  • b4xpages_admob_example4.zip
    40.5 KB · Views: 37
Last edited:

Send and Recive SMS from PC using AsyncStreams in Wifi e VB.Net

android 12


  • SMSWifi12.zip
    114.4 KB · Views: 51
  • wifiSMS.zip
    118 KB · Views: 44

[B4X] TextEditor - Save and load external files

This is a B4i and B4A example, which demonstrates various external files related tasks.


The behavior is not exactly the same as the platforms capabilities and behavior...


  • TextEditor.zip
    184.2 KB · Views: 570
Last edited:

ScrollView examples summary

Last edited:

[B4X] Simple audio call over internet with own TURN/relay server


  • [B4A] Socket.io Simple Call Example.zip
    116.8 KB · Views: 771
  • [B4i] Socket.io Simple Call Example.zip
    111.7 KB · Views: 566
  • [Server] Socket.io Simple Call Example.zip
    2.4 KB · Views: 747
Last edited:

💡 Tic-Tac-Toe. Simple XUI cross platform WiFi game example B4A vs B4i vs B4J - Newer developers

Requires B4A V9.90 or higher.

Hello fellow B4X developers.
Here is my example of using a broadcast address to automatically find another devices IP address on a network, then to use that IP...
Last edited:

Check if the application is running on a Chromebook

If you want to check if the application is running on a Chromebook (for example to do some specific GUI reconfiguration to run in a resizable Window), you can use the following routine.
Hope it...

How to convert from Firebird to Sqlite

I had to deal with a database format transformation problem from Firebird to SqliteDb
I want to share my experience because I've already seen some users who asked questions about Firebird...

User selection of a voice for Text To Speech.

I've just added a speech to text facility to my note taking app using

and text...
Last edited:

Intents and receivers

With the new imodules that allow you to work better with the intent and receivers, it is necessary to develop some examples of how to use them (even before it could be done but not in...


  • device_filter.zip
    413 bytes · Views: 64
  • IntentUSB.zip
    10.6 KB · Views: 58
Last edited:

Geofence - Monitoring a region in the background

Geofencing is an Android feature that allows your app to be notified when the user enters or exits a monitored region.

The nice thing about this feature is that your app doesn't need to run for...


  • Geofence.zip
    15.6 KB · Views: 92
Last edited:

Receivers and Services in 2023+

In the early days of Android services were simple to use and powerful. They allowed doing all kinds of things in the backgrounds with very few restrictions. That's not the case with newer versions...
Last edited:

AdMob mediation with Meta - Facebook and 20+ other networks (not tested)

This tutorial assumes that you already have FirebaseAdMob2 implemented in your app.

Implementation is tested in native Android app, not in B4A. You can test it if you want.

You need to...
Last edited: