B4X

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
B4X
Developer(s)Anywhere Software | Erel Uziel
Operating systemMicrosoft Windows
Available inEnglish
TypeProgramming
LicenseShareware
WebsiteB4x.com

B4X is a suite of rapid application development IDEs that allows the creation of applications on the following platforms: Google Android, Apple iOS, Java, Raspberry Pi and Arduino. B4X programming language is a Proprietary dialect of Visual Basic (hereinafter called "B4X"). B4A, B4i, and B4J feature a visual designer that simplifies the process of creating user interfaces. B4R cannot create GUI applications due to the nature of single-board and SoC devices.



Basic4PPC[edit]

Basic4ppc (pronounced "Basic for PPC") was the first IDE produced by AnywhereSoftware. Basic4ppc allowed programmers to write applications for Pocket PC devices that ran the Windows Mobile operating system. The first release was sometime in 2005 and the final release was between December 5th, 2010 and December 19th, 2018.

NOTE: Basic4PPC is no longer available for download or purchasing.

B4A[edit]

B4A, formerly known as Basic4android, is the second IDE produced by Anywhere Software. The first public version was released on December 7, 2010 and allows users to code native Android apps in B4X. B4A is able to create apps, widgets, and games. There is also a beginners guide that is updated after each new release of the IDE.[1] The latest version of was released on December 31st, 2018. For a history of releases please see the B4A Changelog.

B4i[edit]

B4i is the fourth IDE produced by Anywhere Software. B4i is capable of creating applications that target iPhone and iPad devices and there is a service which allows developers to compile and publish apps without the need for a local Mac computer. The first public version was released on November 14, 2014. B4i allows users to code iOS (iPhone/iPad) apps using B4X. The latest release was released on January 17th, 2019. For a history of B4i releases see the B4i Changelog.

B4J[edit]

B4J is the third IDE produced by Anywhere Software. The first public version was released on December 4, 2013. B4J targets the following platforms: Desktops, Web Servers, and ARM Boards such as Raspberry Pi. The latest public version was released on December 31st, 2018. For a history of releases please see the B4J Changelog.

B4R[edit]

B4R is the fifth IDE produced by AnywhereSoftware. B4R allows programmers to write applications for Arduino boards. Supported Arduino modules include: ESP8266 and ESP32. The latest version was released on June 3rd, 2018. For a history of releases please see the B4R Changelog.

Code Examples[edit]

Code Comments[edit]

Comments are usually used to point out what a particular piece of code does. Comments can also be used to describe whole methods. Use comments for whatever you want!

'This is a comment

Generating a Random Number, then displaying the number in a Message Dialog.[edit]

The following code can be shared between B4A and B4i with no changing:

Sub Button1_Click
    Dim Random As Int
    Random = Rnd(1, 10)
    MsgBox(Random, "Your Number")    
End Sub

Since B4J uses JavaFX, the GUI code will be different. This is the same example in B4J:

1 Sub Button1_Action
2     Dim Random As Int
3     Random = Rnd(1, 10)
4     fx.MsgBox(FormVariableName, Random, "Your Number") 'fx.MsgBox is a feature available in B4J 4.00 or higher.
5 End Sub

In more recent versions of B4X, a "Click" event was added to B4A and B4i so thus the above example can be done with one "Sub"/"Method" as follows:

1 Sub Button1_Click
2     Dim Random As Int = Rnd(1, 10)
3     #If B4J
4     fx.Msgbox(Form, Random, "Your Number")
5     #Else
6     MsgBox(Random, "Your Number")
7     #End If
8 End Sub


References[edit]

  1. ^ "Android Tutorial - B4A Beginners Guide | B4X Community - Android, iOS, desktop, server and IoT programming tools". www.b4x.com. Retrieved 2016-01-17.