Tutorials & Examples

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

[B4X] [B4XPages] What exactly does it solve?

B4XPages makes many things simple and even trivial.
As Android developers, we are dealing with these challenges for many years now so it might take us a while to understand how simple things can...
 
Last edited:

[B4X] Creating a cross platform custom view packed as b4xlib

The attached b4xlib library is a cross platform list of colors:

firefox_86IZH8vlHm.png


It is a XUI custom view. The custom view is based on two...
 

Attachments

  • ColorsListProject.zip
    18.4 KB · Views: 725
  • B4J ColorsList Usage Example.zip
    1.9 KB · Views: 707
  • ColorsList.b4xlib
    9.4 KB · Views: 620

[B4X] [B4XPages] Network + AsyncStreams + B4XSerializator

java_USPawWZPiX.png


1592139571839.png


B4i_nUuTQqGuEH.png


Cross platform version, based on B4XPages, of...
 

Attachments

  • Network Example.zip
    220.7 KB · Views: 2,914
Last edited:

[B4X] CloudKVS - synchronized key / value store

CloudKVS solves a difficult and common problem. The user needs to work with online data, however as this is a mobile app we cannot assume that the device will always be connected to the remote...
 

Attachments

  • B4J_ServerKVS.zip
    2.8 KB · Views: 2,271
  • B4i_ClientKVS.zip
    8.7 KB · Views: 1,364
  • jBuilderUtils.zip
    2.3 KB · Views: 2,817
  • B4A_ClientKVS.zip
    11.6 KB · Views: 2,254
  • B4J_ClientKVS.zip
    6.4 KB · Views: 1,749
Last edited:

[B4X] Cross platform example

i_view64_27Givs3HpE.png


This is a simple example that demonstrates a recommended method of sharing code and files between B4A, B4i and B4J.
It is...
 

Attachments

  • Guess My Number.zip
    227.1 KB · Views: 826
Last edited:

Simple Compass

Have done this just for the fun of it. Have wrapped this posting. The B4A code is short and sweet:

B4X:
#Region  Project Attributes
    #ApplicationLabel: Compass
    #VersionCode: 1...
 

Attachments

  • TheJavaCode.zip
    37.4 KB · Views: 1,041
  • b4aCompass.zip
    105.8 KB · Views: 1,367
  • CompassLibFiles.zip
    6.5 KB · Views: 1,383

[B4X] SwiftButton - Adding Click/LongClick event

The next code add the funcionality in b4x to capture the click & longClick using Touch, in case of b4j add the option to fire the longClick using the Right Mouse Click or the secondary mouse...
 

COVID-19 Info Example

Hi,

Had made an application in B4A (my first in B4A) to display COVID-19 statistics.
Lots of data is specific to India. You can change them to reflect data from your country.

Used quite a bit of...
 

Attachments

  • pkCovid.zip
    372.1 KB · Views: 629
Last edited:

IDE Color Schemes

Last edited:

[B4X] Create Thumbnail and save it

Usage:
SavePictureToFile(XUIImageToJPEGByteArray(CreateThumbnail(xui.LoadBitmapResize(File.DirAssets,"Snapchat-248558753.jpg",150dip,150dip,True)),150dip,150dip,50),File.DirRootExternal,"test.jpg")
...
 

[B4X] xCLV + PreoptimizedCLV + BCTextEngine

1590306481550.png


This example uses PreoptimizedCLV to create a list of BBCodeViews.
In most cases it will be simpler to create a single BBCodeView, as BBCodeView is scrollable. However there might be...
 

Attachments

  • BBCodeCLV-B4A.zip
    24.1 KB · Views: 825
  • BBCodeCLV-B4i.zip
    184.8 KB · Views: 586
  • BBCodeCLV-B4J.zip
    17 KB · Views: 599
Last edited:

[B4X] I need 100 <custom view here>s. How to add programmatically?

Custom views are designed to be added with the designer.

It is however very simple to create a layout file with the custom view and load it multiple times...
 

[B4X] How to get <custom view here> from <CLV or any other container>

This is a common question and for a good reason.

Custom views classes are not views by themselves.
The views tree only holds views.
This means that this code cannot work:
B4X:
Dim...
 
Last edited:

[B4X] Text, Strings and Parsers

This guide is relevant for B4A, B4i and B4J.

There are all kinds of tools and libraries available for the different text based formats. The purpose of this guide is to organize the available...
 
Last edited:

RippleView

The attached project comes from here (I have conducted some open heart surgery on it). It is working perfectly on my 7" tablet but on my Samsung S4 mini, unlike what is the case on my...
 

Attachments

  • b4aRippleView.zip
    38.2 KB · Views: 1,076
  • JavaCode.zip
    145.6 KB · Views: 960
Last edited:

How to connect to SQL Server using jtds-1.3.1.jar

This subject keeps coming up so I thought I would do a tutorial and sample programs. One is B4A, the other is B4J. If you want code examples download the programs.

The B4J I created for testing...
 

Attachments

  • SQLTestB4A.zip
    8.6 KB · Views: 1,214
  • SQLTestB4J.zip
    3.3 KB · Views: 867
Last edited:

RTL Layout Support

1.Declare in your app manifest that your app supports RTL mirroring.
Specifically, add below code in your manifest.
B4X:
SetApplicationAttribute (android:supportsRtl, true)

2. Copy the code you...
 
Last edited:

Complete tutorial: B4A & Your own (local) php & MySql Server (Xampp) with b4a

Update:

Newer releases of XAMPP come with MariaDB except of MySQL. Basically the same but the php scripts have to be changed a little bit:

- mysql is changed to mysqli
- "$con"...
 

Attachments

  • Example_B4A_APP_Xampp.zip
    9.7 KB · Views: 4,451
  • persons.zip
    582 bytes · Views: 3,896
Last edited:

COVID API

API for live information about COVID-19

##source##


B4X:
Sub covid

    Dim cov1 As HttpJob
    cov1.Initialize("GetAddress", Me)...
 

Attachments

  • cov.zip
    14.1 KB · Views: 625
  • Screenshot_1584876341.png
    Screenshot_1584876341.png
    8.4 KB · Views: 807
  • Screenshot_1584876347.png
    Screenshot_1584876347.png
    10.4 KB · Views: 877
  • Screenshot_1584895171.png
    Screenshot_1584895171.png
    18.2 KB · Views: 825
Last edited:

[B4X] Manage your own Let´s Encrypt Certificates (ACME Client)

While looking around on interesting projects to wrap i found a java console app (jar file) which is able to create and manage Certificates which can be used in your Server.
It manages Let´s...
 
Top