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:

mpAndroidCharts - Various Charts using JavaObject

Have never done a B4A "wrapper" before making use of JavaObject only and thought I would see if I could get the PieChart of mpAndroidCharts implemented by using B4A's JavaObject only...
 

Attachments

  • mpChartLib.jar
    360.7 KB · Views: 74
  • mpAndroidPieChartJO.zip
    9.9 KB · Views: 67
Last edited:

Simple function to convert Markdown Text to CSBuilder Format

This simple function converts Markdown-formatted text so that it can be used as CSBuilder.

This is particularly useful if, for example, you have created a text in MS Word with bold and...
 

Attachments

  • md2cs.zip
    9.6 KB · Views: 17

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:

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

[B4X] AS Onboarding - Dark and Light mode switch


In this example I show how you can easily change the theme e.g. from a dark theme to a light one and how to...
 

Attachments

  • Light and Dark Example.zip
    246.5 KB · Views: 31

Background location tracking

SS-2018-11-29_15.48.38.png


Simple example of a foreground service that keeps the process running in the background. The current location is shown in...
 

Attachments

  • MyLocation.zip
    10.6 KB · Views: 147
Last edited:

select image from device and upload in server

well hi too all .
As the title suggests, I want to teach you how to upload photos
I had searched a lot about it myself and had not found any results. By changing other people's codes, I was able...
 

CustomCardView Base On CustomListview Module

This is a module base on CustomListview, all function same with CustomListview I call it CustomCardView. Hope this help.

B4X:
For I = 0 To 5
'(the 47%x is cardview width, and the 45%y is the...
 

Attachments

  • CustomCardViewExample.zip
    14.2 KB · Views: 592
  • CustomCardView.bas
    8.6 KB · Views: 561

[B4X] Supabase - Call a Postgres function (RPC)


Perform a function call.
You can call Postgres functions as Remote Procedure Calls...
 

Google Play Billing v.7 Subscription Example

This is a modified example, based in the original example from @Erel.
The previous example only make purchases.
This new example utilizes the Google Play Billing library v.7, changes...
 

Attachments

  • BillingExample7.zip
    11.1 KB · Views: 87

Share Text File Between 2 Apps

This is just another example based on the ManageExternalStorage class provided by @agraham.
It is a response to this question.

B4ARepositoryWriter - writes a text file to an...
 

Attachments

  • B4ARepositoryWriter.zip
    11.3 KB · Views: 93
  • B4ARepositoryReader.zip
    11.4 KB · Views: 92

Http Server hosting a page with download link

Just a simple example with a link to a file stored in File.DirInternal.

Required Archiver library.

1717247361585.png


This is a response to this thread.
 

Attachments

  • HttpServer.zip
    12.4 KB · Views: 97
Last edited:

Running B4A and B4J under Linux with wine - fully functional

I have just managed to install B4A and make it run (including B4ASdkManager) on my Xubuntu 18.04 and, since I have lost two days and one night putting things together, I thought it will be a good...
 
Last edited:

Share SQLite database between 2 devices

This is just a proof of concept to show that Device A behave like a server hosting a database and Device B connects to it accessing the "shared" database. It is a response to this question...
 

Attachments

  • ShareDB.zip
    17.6 KB · Views: 211
Last edited:

Example Spinner to Bold, Italic or other typeface

Widget Layout Background

I'm just trying to add a background image to the 4x1 widget from the following excellent thread...
 

Attachments

  • Widget Test.zip
    193.5 KB · Views: 95

Widget Layout (Resizable, Adaptive)

Not sure if this can be considered a Tutorial, my first attempt.
Lately I started to play with Widgets, mostly for curiosity.
The main problem I encountered was how to design the Layout to make it...
 

Attachments

  • Widget Test.zip
    214.6 KB · Views: 110
Last edited:

FREE Source Code's !

Hi all,

i have updated my webpage and decided to add a tutorial section.

My first tutorial is a simple calculator (+,-,*,/) there is a video tutorial incl. Source code on my site.

I will upload...
 

Attachments

  • t1calc.zip
    3.7 KB · Views: 3,265
Last edited:

[B4X] AS FloatingActionMenu - Open Menu above an item in a xCustomListView


In this example, I let the AS_FloatingActionMenu open over an item that is in a list, no matter...
 

Attachments

  • ActionMenu + CustomListView.zip
    182.1 KB · Views: 104

[B4X] AS TextFieldAdvanced - TitleMode (AboveTextField, FloatText and BeforeTextField)

Top