Android Tutorial [B4X] Documentation Booklets

klaus

Expert
Licensed User
Several B4X documentation booklets are available, Download Link.

These booklets cover the four B4X products.
Some don't cover B4R because the subject is not relevant for B4R like Visual Designer.

Example projects with source code are included.

General booklets:
B4X Getting started
This booklet explains how to start with each B4x product (B4A, B4i, B4J and B4R).
B4X Basic Language
This booklet explains the Basic Language for B4A, B4i, B4J and B4R.
B4X IDE
This booklet explains the Integrated Developpment Environment for B4A, B4i, B4J and B4R.
B4X Visual Designer
This booklet explains the Visual Designer for B4a, B4i and B4J.

Specific booklets:
B4X Custom Views + CustomViews_SourceCode, specific code for this booklet.
This booklet explains the CustomView subject for B4A, B4i and B4J.
B4X Graphics
This boouklet explains Graphics for B4A, B4i, B4J, XUI And BitmapCreator.
B4X XUI
This boouklet explains the XUI library which makes it easier to share code between B4A, B4J and B4i projects.
B4R ExampleProjects
This booklet explains some B4R example projects.
B4X SQLiteDatabase
This booklet explains the use of the SQLite library
B4X JavaObject-NativeObject
This booklet explains the use of JavaObjects (B4A and B4J) and NativeObjects (B4i)

All files are included in the zip file.

The current editions are 1.6
All booklets have the same edition number, to avoid confusion.
They cover:
B4A version 9.50
B4i version 6.00
B4J version 7.80
B4R version 3.00

Future booklets:
none in the pipeline

These booklets replace the product specific Beginner's Guides and the B4A User's Guide.

Some of these booklets exist in other languges:

Español, Spanish.
Translated by Manuel Martinez.

Français, French.
Translated by myself.
 
Last edited:

Genival Carvalho

Member
Licensed User
@klaus maybe Stock file is missing in IDETabs example.
Error at file EditStock => Activity.Title = "Stock " & Main.StockEditMode
Or Main file is breaked

Regards.
 

klaus

Expert
Licensed User
Thank you for reporting this.
Add the two lines below in the Process_Globals routine in the Main module.
B4X:
Sub Process_Globals
    Public StockEditMode = "ADD" As String
    Public StockSelectedRowID As Int
End Sub
Is amended for the next edition.

Best regards.
Klaus
 

Genival Carvalho

Member
Licensed User
Thank you for reporting this.
Add the two lines below in the Process_Globals routine in the Main module.
B4X:
Sub Process_Globals
    Public StockEditMode = "ADD" As String
    Public StockSelectedRowID As Int
End Sub
Is amended for the next edition.

Best regards.
Klaus
Klaus,

The main file is empty in your booklet example.
Could you, please, add this file here.

Regards,
Genival
 

klaus

Expert
Licensed User
The purpose of this example program is to show the Modules Tab in the IDE with several Modules in the main file.
The content of the new Main module is:
B4X:
Sub Process_Globals
    Public StockEditMode = "ADD" As String
    Public StockSelectedRowID As Int
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
The only difference are the two lines in post #6.

This project is a reduced version of the SQLiteLight4 project from the B4A User's Guide.
 

John W. Miescher

Member
Licensed User
Several B4X documentation booklets are available, Download Link.

These booklets cover the four B4X products.
Some don't cover B4R because the subject is not relevant for B4R like Visual Designer.

Example projects with source code are included.

Dear Klaus,
your booklets and your contribution to Seagraves book have been of great help but now I am struggling with Android 26+ and find the help available spread out and not complete.

Do you have (or know of) examples from which a hobby programmer like me could learn how to
  • download files and store in a separate file location (to survive program updates)
  • launch an mp4 file in the exo player
  • open a PDF file in Acrobat Reader
  • etc. ?

thanks for your help,
john m., Geneva/CH
 

klaus

Expert
Licensed User
You should have posted theses questions in the questions forum as they are not directly related to the B4X Booklets.

I am struggling with Android 26+
Did you have a look at this: android.jar / targetSdkVersion / minSdkVersion
download files and store in a separate file location (to survive program updates)
You can use the File.DirInternal folder.
This is a dedicated folder for the program, but it cannot be accessed by other applications.
If you need to access the files from outsides the application you should ger the folder with the RuntimePermissions library with:
MyFolder = RuntimePermissions.GetSafeDirDefaultExternal(SubFolder As String)
If you don't want a subfolder, enter an empty string.
Don't use File.DirRootExternal nor File.DirDefaultExternal.
launch an mp4 file in the exo player
I have never played a mp4 file nor used ExpPlayer, did you have a look at this ExoPlayer - MediaPlayer / VideoView Alternative?
open a PDF file in Acrobat Reader
I have used pdf with B4A, just one time for testing quite some time time ago.
 

John W. Miescher

Member
Licensed User
You should have posted theses questions in the questions forum as they are not directly related to the B4X Booklets.


Did you have a look at this: android.jar / targetSdkVersion / minSdkVersion

You can use the File.DirInternal folder.
This is a dedicated folder for the program, but it cannot be accessed by other applications.
If you need to access the files from outsides the application you should ger the folder with the RuntimePermissions library with:
MyFolder = RuntimePermissions.GetSafeDirDefaultExternal(SubFolder As String)
If you don't want a subfolder, enter an empty string.
Don't use File.DirRootExternal nor File.DirDefaultExternal.

I have never played a mp4 file nor used ExpPlayer, did you have a look at this ExoPlayer - MediaPlayer / VideoView Alternative?

I have used pdf with B4A, just one time for testing quite some time time ago.
Thank you, Klaus.
This does, unfortunately, not help me any further as the directory thus created plus any content is removed again when the user uninstalls or updates the app. I've found some examples using FileProvider and I'll see if I can solve the problem in this way

john m.
 
Top