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.
#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:
Libraries filter box:
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).
#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).
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.
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.)
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.)
' 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))"
#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
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))"
#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
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.
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.