Yes, this sample works, but it's necessary to remember about some moments.
1) CSBulder was integrated to B4A later than other components.
And some functions return string instead of charSequence.
For example, you want to return the text inside EditText.
Theoretically, the following should work
Dim charsequence As CSBuilder
...
charsequence = EditText.Text
But compiler talks:
error: incompatible types: String cannot be converted to SpannableStringBuilder
_s.setObject((android.text.SpannableStringBuilder)(mostCurrent._edittext.getText()));
The workaround:
Dim jo As JavaObject
Dim charsequence As CSBuilder
...
jo = EditText
charsequence = jo.RunMethod ("getText", Null)
2) Instead of subString it's necessary to use subSequence.
For example,
Dim jo As JavaObject
Dim charsequence1 As CSBuilder
Dim charsequence2 As CSBuilder
...
jo = EditText
charsequence1 = jo.RunMethod ("getText", Null)
jo = charsequence1
charsequence2 = jo.RunMethod ("subSequence", Array (2, 5))
3) If you use "Image", each image is equal to one character in such functions as charsequence.Length, EditText.SelectionStart etc.
4) I found one strange moment relative to images (maybe a bug).
Imagine that we want to output two the same images.
Dim b1 As Bitmap
Dim cs As CSBuilder
Dim cs1 As CSBuilder
...
b1 = LoadBitmap (...)
cs1.Initialize.Image (b1, 24dip, 24dip, False)
cs.Initialize.Append (cs1).Append (cs1)
EditText.Text = cs
This should work, but does not - instead of second image appears "_".
Meanwhile following works
Dim b1 As Bitmap
Dim cs As CSBuilder
Dim cs1 As CSBuilder
Dim cs2 As CSBuilder
...
b1 = LoadBitmap (...)
cs1.Initialize.Image (b1, 24dip, 24dip, False)
cs2.Initialize.Image (b1, 24dip, 24dip, False)
cs.Initialize.Append (cs1).Append (cs2)
EditText.Text = cs