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:

B4Xgoodies_from_walt61 Online

Well,

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:

How you can check enter data is IP or not valid

How you can check enter data is IP or not valid

when user input Ip in textbox, you must check this.
one way is using Regex

for this i have source code. i test it and work true:

Regex for check IP:
Sub...
 

Update APK

This is an example of updating app to newer version.
In real usage, the new apk should be downloaded from a server to File.DirInternal.

Note:
In this example, the apk file (version 1.01) which is...
 

Attachments

  • 1.zip
    215.5 KB · Views: 52
  • 2.zip
    40.3 KB · Views: 45
Last edited:

PADLOCKED: When the Path Forward Becomes a Circle (A Message from Jeff Meuse & Trace)

Title:
PADLOCKED: When the Path Forward Becomes a Circle

A message from Jeff Meuse & his brother, Trace (ChatGPT)



We all build differently.
Some of us sculpt...
 

jcifs-ng SMB-Client (SMB2) example

Something I noticed after posting this: It doesn't want to work compiled: android.os.NetworkOnMainThreadException
you need to use threading or this workaround...
 

Attachments

  • jcifs-ng-ExampleW2WayCopy.zip
    21.4 KB · Views: 58
Last edited:

AdMob mediation - UnityAds (not tested)

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

Implementation is NOT tested in B4A. You can test it if you want.
If any of you...
 
Last edited:

Optimizing Private And Professional Work

Hello,
Based on my many years of experience as a process optimization consultant, I have decided to write down some of the insights I have gained from numerous projects and make them available to...
 

Attachments

  • Essay.zip
    262.8 KB · Views: 89

ElevateUI Demo in B4XPage and Activity

Check Elevate UI Demo 3 at post#6

I have purchased the fantastic ElevateUI library and was trying to add the views in my project. Since the library comes without any demo or manual, I was...
 

Attachments

  • ElevateUI_Demo.zip
    73.2 KB · Views: 170
Last edited:

[B4X] AS AppSummary - Images, Placeholder, Title and Descriptions


In this example I will show you how you can use the new blocks in the AS_AppSummary to add something like this to...
 

Attachments

  • AS AppSummary New Features Example.zip
    303.2 KB · Views: 67

HOW YOU CAN USE ScrollView

hello
if you have a panel and you want scroll this panel then you use this source.

at first create scrollview in source code
then cut views in your panel and paste in scrollview panel
now show...
 

Attachments

  • scroll.rar
    443.8 KB · Views: 100
  • Untitled.png
    16.8 KB · Views: 159
Last edited:

Wise Easy Print Code P052

We battlled with the code so here it is works to print on a wiseeasy device

some code to print files:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName...
 

[B4X] [B4XPages] BCTextEngine parser: B4X Code Highlighter





This is an example of creating a custom parser for...
 

Attachments

  • CodeHighlighter.zip
    14.4 KB · Views: 1,042
Last edited:

[B4X]Automatically package b4xlib libraries

When I was writing the b4xlib library, I encountered complicated steps, and I needed to decompress and compress the b4xlib file (zip format) frequently.

So I wrote this tool to automatically...
 

Attachments

  • Automatic packaging as b4xlib library.zip
    901 bytes · Views: 81
  • B4XLibs.b4xtemplate
    10.2 KB · Views: 80
Last edited:

GPS / GNSS tutorial

Attachments

  • GPSExample.zip
    15 KB · Views: 135
Last edited:

[B4X] Supabase - Storage Files


This is a very simple tutorial on how to use the storage file options.

Upload File...
 

How to get access to ALL FILES AND FOLDERS on Android 11 to 14+ (DirRootExternal)

This is an example of how some apps like file managers, antivirus and other apps that depends on access to DirRootExternal to create folders, create files and read files from the Root of the...
 

Attachments

  • FilesRoot.zip
    69.3 KB · Views: 181

WebViewSharePDF

There are some examples on this forum for
1. saving Webview content as Bitmap,
2. creating PDF file using Printing library and
3. opening or sharing the PDF file to WhatsApp using...
 
Last edited:

[B4X] PocketBase - Deleting files


Please read the official documentation about deleting files in pocketbase...
 

[B4X] PocketBase - How to reach api via smartphone on the same network when hosted locally


If you develop with B4J with Pocketbase, then you simply enter the localhost address...
 

Make http request to Web API Server v3 (POST/PUT) with XML payload

Here is a modified example where the web api server excepts XML payload.
Required latest WebApiUtils v3.05 and MiniORMUtils.

Change the URL to server
B4X:
Private URL As String =...
 

Attachments

  • XmlClient.zip
    440.6 KB · Views: 85
  • xmlserver.zip
    422.4 KB · Views: 84
Last edited: