Update about the next version (2.70)

Erel

B4X founder
Staff member
Licensed User
Longtime User
Basic4android v2.70 BETA 1 was released.

The new features and improvements are:

- Compiler warnings. There will be about 30 types of warnings. Most of them detected whenever you save the project (or with the new "test compilation" option).



Note that the logs support colors to make it easier to see the errors, warnings and "info" messages. There is also a new keyword named LogColor which allows you to log messages in a specific color.

The warnings engine is very useful for both large projects and small projects and it finds many common mistakes (or possible mistakes) before you even run the program.

- Custom views. The designer will support adding custom views (with classes or libraries).






- Classes support properties.



The property code in this case is:
B4X:
'Gets or sets the text
Sub getText As String
   Return btn.Text
End Sub
Sub setText(t As String)
   btn.Text = t
End Sub

- Bitmaps handling improved - LoadBitmap / LoadBitmapSample handle "out of memory" errors internally by down-scaling the image. This also affects the visual designer.

- DateTime.ListenToExternalTimeChanges - raises an event when the device time is set or when the time zone changes (and updates the internal time zone used).

- Screenshot tool improved.

- CallSub improvements:
Returns Object instead of String.
Sender is set when calling from a class.
Significant performance improvements when calling subs in classes.
No error is raised if the target sub is not found when calling from a class (useful for events implementations).

- #LibraryName attribute.

- Library dependencies resolver can now handle cases as described here.

- Bug fixes and other minor improvements.

Edit: The beta is now released. Users who are eligible for a free upgrade will receive an email with the download link.

Thank you for your help. Please start new threads if you encounter any issue.

As this is a beta version, make sure to backup your projects before loading them with the new version.
You can install this version together with previous versions.
 

barx

Well-Known Member
Licensed User
Longtime User
Sounds great!

:sign0060:
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Great Erel, thank you. Can't wait to try the beta.
 
Upvote 0

Vader

Well-Known Member
Licensed User
Longtime User
Looks great!

Regarding the warnings - did you consider putting the numbers before the description and format them?

Something like:

WARN011 - 'Variable sb was not initialized'
WARN012 - 'Sub Example was not used'

Also, is there a way to suppress certain warning codes?
 
Upvote 0

MLDev

Active Member
Licensed User
Longtime User
The best Android programming environment just got better. :sign0162: Thanks Erel!
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
did you consider putting the numbers before the description and format them?
I think that the number is less important. Its main purpose it to help you with disabling a warning. Warnings can be disabled in two ways:
- Add an "ignore" comment at the end of line:
B4X:
Dim sb As StringBuilder 'ignore
- With the new #IgnoreWarnings module attribute:
B4X:
#IgnoreWarnings: 11, 12
 
Upvote 0

bsnqt

Active Member
Licensed User
Longtime User
Great news!!! I am pround to be a part of the B4A community
Can't wait for 2.70
 
Upvote 0

Penko

Active Member
Licensed User
Longtime User
Is property code generated automatically(because I didn't fully understand how is this implemented)? I mean, should we write more like the .NET syntax:

B4X:
Property Test()
        Get
           Return _test
        End Get
        Set(ByVal value)
                _test = value
        End Set

    End Property

Of course in Basic4Android the internal variable can't start with "_" but I am just giving the .NET side of the story.

Or we should implement the setTest, getTest manually, as shown on the screenshot?
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The rules for properties:
- Only relevant for classes.
- One or two subs with the format get<prop> set<prop>. Note that get / set must be lower case.
- A property can be read-only (only get), write-only (only set) or both.
- The two subs types (parameter in the set sub and return type in the get sub) must be the same.
- Within the class you should call the methods directly. The property will not appear.

Note that this change will not break any existing code.

For example:
B4X:
'Gets or sets the text
Sub getText As String
    Return btn.Text
End Sub
Sub setText(t As String)
    btn.Text = t
End Sub

 
Upvote 0

yttrium

Active Member
Licensed User
Longtime User
Aww Erel, no separate Spinner dropdown text colors?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…