Android Tutorial [B4X] Erel Teaches Programming - video tutorials

Status
Not open for further replies.
ETP is a series of video tutorials about B4X. The purpose is to allow developers with any programming experience, including no experience, to learn how to program with B4X.

The videos are available here: https://www.b4x.com/etp.html

If you prefer YouTube: https://www.youtube.com/playlist?list=PLSXGv13TotQZUPJCw1lnxeaPsfYjns5W-

It is recommended to watch the videos on a desktop screen with 1920x1080 or higher resolution.
Make sure to see the videos in 1080 HD:

SS-2018-01-30_16.37.47.png


Feedback and suggestions thread: https://www.b4x.com/android/forum/threads/etp-video-tutorials-feedback-and-suggestions.89862/

Download all videos (2gb): https://drive.google.com/open?id=1bDiVwRoemQ6Q8cWNkYQ55kJT4wCEofIW
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
New video: dynamic controls
Most developers will learn something from it.

B4J Code from the tutorial that creates a nice grid:

B4X:
Sub Process_Globals
   Private fx As JFX
   Private MainForm As Form
   Type ButtonData (ClickCount As Int, Column As Int, Row As Int)
   Private buttons As List
   Private Const GRID_SIZE As Int = 10
   Private xui As XUI
End Sub

Sub AppStart (Form1 As Form, Args() As String)
   MainForm = Form1
   MainForm.Show
   CreateGrid(GRID_SIZE, GRID_SIZE)
End Sub

Sub CreateGrid (NumberOfColumns As Int, NumberOfRows As Int)
   buttons.Initialize
   Dim gap As Int = 2dip
   Dim BtnWidth As Int = MainForm.RootPane.Width / NumberOfColumns - gap
   Dim BtnHeight As Int = MainForm.RootPane.Height / NumberOfRows - gap
   For x = 0 To NumberOfColumns - 1
       Dim Column As List
       Column.Initialize
       buttons.Add(Column)
       For y = 0 To NumberOfRows - 1
           Dim btn As Button
           btn.Initialize("btn")
           Dim bd As ButtonData
           bd.Initialize
           btn.Tag = bd
           bd.Column = x
           bd.Row = y
           MainForm.RootPane.AddNode(btn, x * (BtnWidth + gap), y * (BtnHeight + gap), BtnWidth, BtnHeight)
           Column.Add(btn)
       Next
   Next
End Sub

Sub GetButton(Column As Int, Row As Int) As Button
   Dim columnList As List = buttons.Get(Column)
   Return columnList.Get(Row)
End Sub

Sub btn_Click
   Dim btn As Button = Sender
   Dim bd As ButtonData = btn.Tag
   bd.ClickCount = bd.ClickCount + 1
   btn.Text = "Click: " & bd.ClickCount
   For i = 0 To GRID_SIZE - 1
       Dim xview As B4XView = GetButton((bd.Column + i) Mod GRID_SIZE, bd.Row)
       xview.SetColorAnimated(500, xui.Color_White, xui.Color_Green)
       xview = GetButton(bd.Column, (bd.Row + i) Mod GRID_SIZE)
       xview.SetColorAnimated(500, xui.Color_White, xui.Color_Red)
       Sleep(100)
   Next
End Sub
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
New video: XUI - Cross Platform Example.
This is an important video for any developer that is interested in cross platform development. It is based on the same example as in the previous tutorial. This time it is implemented as a class shared by B4A, B4J and B4i.
The new B4XComboBox class is used instead of the ComboBoxes in the previous example.
 
Status
Not open for further replies.
Top