Other B4A v3.80 BETA is released

Erel

B4X founder
Staff member
Licensed User
Longtime User
I'm happy to release B4A v3.80 BETA. This version includes several major new features that make it easier to develop real-world solutions and reuse code between different projects.

New features and improvements:
  • Conditional Compilation & Build Configurations: http://www.b4x.com/android/forum/threads/conditional-compilation-build-configurations.40746/
  • Shared code modules: http://www.b4x.com/android/forum/threads/shared-code-modules.40747/
  • #AdditionalJar attribute - Allows adding jar files to the compilation. Together with JavaObject library it is now possible to use 3rd party libraries without a wrapper (not in all cases).
  • Project meta file - This file stores "dynamic" project state: modules visibility and order, collapsed nodes, bookmarks and breakpoints. This file should be excluded from source controls.
  • Bit.InputStreamToBytes - Reads all the data from an input stream and returns an array of bytes with the data. The input stream is closed automatically.
  • JSON generator supports arrays as well as lists.
  • CreateMap keyword - A shorthand method for creating and filling Maps. For example:
    B4X:
    Dim m1 As Map = CreateMap("Key1": 10, "Key2": 20)
  • Array keyword - The type can be omitted. In that case the array type will be Object. The Array keyword now supports creating empty arrays.
  • Spinner.DropDownBackgroundColor property
  • Debugger can optionally show hexadecimal values.
  • Auto complete for layouts and assets files:

    SS-2014-05-08_12.22.01.png

  • Libraries filter box:

    SS-2014-05-08_12.17.56.png

  • Add existing modules supports multiple selection.
  • New configurable color: ToolTipDefaultText (color of non-code tool tips text)
  • Other minor improvements and bug fixes.

All users who are eligible for a free upgrade should receive an email with the link to the beta version. Please allow 12 hours for this mail to arrive.

Note that this is a beta version. You should backup your projects before loading them with the new version.
Projects saved in v3.80 cannot be opened with older versions of B4A (due to the new meta files).
 
Last edited:

Robert Valentino

Well-Known Member
Licensed User
Longtime User
#AdditionalJar attribute - Allows adding jar files to the compilation. Together with JavaObject library it is now possible to use 3rd party libraries without a wrapper (not in all cases).

Is it possible to use the ControlsFX from this site? http://controlsfx.bitbucket.org/

According to their website
ControlsFX ships as a single zip file which contains the library jar as well as a samples jar.

They have a SpreadSheetView http://controlsfx.bitbucket.org/org/controlsfx/control/spreadsheet/SpreadsheetView.html
Which allows A fixed Header Row and Fixed Left Column.

I've tried our Excel example (and saved my SpreadSheet with the Panes Frozen) but only one the top seems to be fixed.

How can I determine what Jar files are allowed with the #additionalJar attribute?

Has ANYONE come up with a working example?

Thanks in advance

PS: This ControlsFX has some real powerful http://controlsfx.bitbucket.org/overview-summary.html features if we can get any of them to work would be a big plus.

BobVal
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
hi erel

since the last update i an error message that the ADB Server is not ready..
and i need to restart ADB Server

i restart my phone and again i can debug my phone but that happens every 2-3 times i debug my phone
2-3 works ok then this message...
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
hi erel

since the last update i an error message that the ADB Server is not ready..
and i need to restart ADB Server

i restart my phone and again i can debug my phone but that happens every 2-3 times i debug my phone
2-3 works ok then this message...
This doesn't seem to be related to the new version. Nothing has changed that is related to the connectivity with ADB.

About #AdditionalJar.
AdditionalJar is quite simple. It adds a Jar file to the compiled APK. If you can use JavaObject to access the third party methods (or Reflection) then you can use the library without a wrapper.
 
Upvote 0

PaulR

Active Member
Licensed User
Longtime User
Very cool update, I was thinking about include/imports over the last couple of days regarding classes and accessing non-Android Java and it turns out that it was already here!

Here's a snippet of code using a 3rd party Java library that shows a 'fully qualified class name' being used that might give somebody a eureka moment....
B4X:
    #AdditionalJar: C:\JavaLibraries\javaosc.jar

Sub Activity_Create(FirstTime As Boolean)
    Dim jo, message As JavaObject

    ' Java code is.....   
    '            OSCMessage message = new OSCMessage("/empty", args);
    ' In the Java code, there would be an 'import' statement allowing OSCMessage to be 
    ' referred to without the package name in front.  We don't have that so use the full name...

    message=jo.InitializeNewInstance("com.illposed.osc.OSCMessage", Array("/empty", Array()))

    'Java code is.....     
    '            final byte[] result = message.getByteArray();
    Dim result() As Byte = message.RunMethod("getByteArray", Null)
End Sub

(You can get javaosc.jar from here if you want it.)
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Very cool update, I was thinking about include/imports over the last couple of days regarding classes and accessing non-Android Java and it turns out that it was already here!

Here's a snippet of code using a 3rd party Java library that shows a 'fully qualified class name' being used that might give somebody a eureka moment....
B4X:
    #AdditionalJar: C:\JavaLibraries\javaosc.jar

Sub Activity_Create(FirstTime As Boolean)
    Dim jo, message As JavaObject

    ' Java code is.....   
    '            OSCMessage message = new OSCMessage("/empty", args);
    ' In the Java code, there would be an 'import' statement allowing OSCMessage to be 
    ' referred to without the package name in front.  We don't have that so use the full name...

    message=jo.InitializeNewInstance("com.illposed.osc.OSCMessage", Array("/empty", Array()))

    'Java code is.....     
    '            final byte[] result = message.getByteArray();
    Dim result() As Byte = message.RunMethod("getByteArray", Null)
End Sub

(You can get javaosc.jar from here if you want it.)


When you say:
' In the Java code, there would be an 'import' statement allowing OSCMessage to be
' referred to without the package name in front. We don't have that so use the full name...

I am trying to use this ControlsFX package. Where would I find the full name? Every time I run my code I keep getting "Class not found"
When I try to do the "GridBase.InitializeNewInstance("GridBase", Array(RowCount, ColCount))"

I have to assume I am not using the right Class Name http://controlsfx.bitbucket.org/ at this URL click on GridBase

B4X:
#AdditionalJar: D:\AndroidProjects\ControlsFX\controlsfx805.jar

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("sMain")

    Dim RowCount       As Int    = 15
	Dim ColCount       As Int    = 10
	
	Dim GridBase       As JavaObject

	
	GridBase.InitializeNewInstance("GridBase", Array(RowCount, ColCount))
	
	
	Dim CurRow         As Int
	Dim CurCol         As Int
	
	For CurRow = 0 To RowCount-1
        For CurCol = 0 To ColCount-1
		    GridBase.RunMethod("setCellValue", Array(CurRow, CurCol, "RC:"&CurRow&"."&CurCol))
	    Next
	Next


Thanks

BobVal
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
When you say:

I am trying to use this ControlsFX package. Where would I find the full name? Every time I run my code I keep getting "Class not found"
When I try to do the "GridBase.InitializeNewInstance("GridBase", Array(RowCount, ColCount))"

I have to assume I am not using the right Class Name http://controlsfx.bitbucket.org/ at this URL click on GridBase

B4X:
#AdditionalJar: D:\AndroidProjects\ControlsFX\controlsfx805.jar

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("sMain")

    Dim RowCount       As Int    = 15
	Dim ColCount       As Int    = 10
	
	Dim GridBase       As JavaObject

	
	GridBase.InitializeNewInstance("GridBase", Array(RowCount, ColCount))
	
	
	Dim CurRow         As Int
	Dim CurCol         As Int
	
	For CurRow = 0 To RowCount-1
        For CurCol = 0 To ColCount-1
		    GridBase.RunMethod("setCellValue", Array(CurRow, CurCol, "RC:"&CurRow&"."&CurCol))
	    Next
	Next


Thanks

BobVal


I tried replacing : GridBase.InitializeNewInstance("GridBase", Array(RowCount, ColCount))
with GridBase.InitializeNewInstance("org.controlsfx.control.spreadsheet.GridBase", Array(RowCount, ColCount))

Which I believe this http://controlsfx.bitbucket.org/org/controlsfx/control/spreadsheet/package-summary.html is telling me is the package name

But still same problem.

BobVal
 
Upvote 0

PaulR

Active Member
Licensed User
Longtime User
I have no idea, that's the correct name according to the docs and the example code. One thing worth pointing out is that the IDE gives a warning when the name of an #AdditionalJar is incorrect/cannot be found so there's no need to worry about that. Sorry there's nothing obvious to point out.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Just took a look at the website for this, it's for JavafX 8, which won't work on Android. Nor will it yet work on B4j as it supports JavaFX 2.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Note that it will work with B4J if you reference Java 8.

Is it as simple as that to access JavaFX 8? Do you know if it is or should be, fully backwards compatible?
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
From what I've read it should be backwards compatible, I suppose the only way to find out is to try it!
 
Upvote 0

ilan

Expert
Licensed User
Longtime User

hi erel

since the last update i an error message that the ADB Server is not ready..
and i need to restart ADB Server

i restart my phone and again i can debug my phone but that happens every 2-3 times i debug my phone
2-3 works ok then this message...
This doesn't seem to be related to the new version. Nothing has changed that is related to the connectivity with ADB.

ok i found out that the reason for that was "not enough storage in my phone"
so i removed some pics and videos and now its working thanx erel
 
Upvote 0
Top