ABMaterial 3.20 will introduce a very cool debug feature! When developing web apps, the console (e.g. in Chrome) can be your best friend. But on mobile devices, you don't have that available. (can be set-up, but I find it a pain in the a$$).
In ABMaterial 3.20, there will be a build-in console. It is using the Conzole javascript library and is very easy to use in B4J.
Video:
Usage:
First, you have to enable the console in BuildPage()
Two methods can be used to show or hide the console programmaticaly. Can be handy as a buid-in tool in your apps where the user enters a code on his device and you can then check the console.
Now you can start doing some cool stuff Some examples:
Show some text, or a server value (note: strings must be between single quotes!)
Here I generated an error on purpose, so the demo can show it catches the error:
Same code, but with the correct javascript syntax, showing the html() value of the tag:
Works also on the desktop, although you probably will use the Chrome console as you can do more.
Alain
In ABMaterial 3.20, there will be a build-in console. It is using the Conzole javascript library and is very easy to use in B4J.
Video:
Usage:
First, you have to enable the console in BuildPage()
B4X:
' params are: open on load, width
page.DebugConsoleEnable(True, 300)
Two methods can be used to show or hide the console programmaticaly. Can be handy as a buid-in tool in your apps where the user enters a code on his device and you can then check the console.
B4X:
page.DebugConsoleShow
page.DebugConsoleHide
Now you can start doing some cool stuff Some examples:
Show some text, or a server value (note: strings must be between single quotes!)
B4X:
page.DebugConsoleLog("'Server click at: " & DateTime.Time(DateTime.Now) & "'") ' shows the text
Here I generated an error on purpose, so the demo can show it catches the error:
B4X:
page.DebugConsoleLog("'value: ' + $('#pi002-r2c1').html();") ' generates an error, the ; at the end is wrong
Same code, but with the correct javascript syntax, showing the html() value of the tag:
B4X:
page.DebugConsoleLog("'value: ' + $('#pi002-r2c1').html()") ' generates the html value of the pi002-r2c1 tag
Works also on the desktop, although you probably will use the Chrome console as you can do more.
Alain
Last edited: