Basic4android v2.71 is released!

Erel

B4X founder
Staff member
Licensed User
Longtime User
Basic4android v2.71 is now available. I would first like to thank the beta testers for their help and feedback :icon_clap:.

This version includes many improvements including several major new features:

  • Compiler warnings - A new warning engine that helps finding common errors as soon as possible:

    SS-2013-05-02_17.41.51.png

  • Custom views with designer support - Developers can create custom views (with classes or libraries) that can be added with the visual designer. This feature makes it possible to build the complete layout with the designer and designer scripts.
  • Classes properties - a long-awaited feature.
  • Bitmaps handling improved - LoadBitmap / LoadBitmapSample internally handle out of memory errors by down-scaling the image. The visual designer loads images based on the target size to preserve memory.
  • DateTime.ListenToExternalTimeChanges - raises an event when the device time is set or when the time zone changes (and updates the internal time zone used).
  • CallSub keyword improvements:
    Returns Object instead of String.​
    Sender is set when calling from a class. This is useful for events implementation.​
    Significant performance improvements when calling subs in classes.​
    No error is raised if the target sub is not found when calling from a class. This is useful for events implementation.​
  • #LibraryName attribute. Sets the compiled library name.
  • Libraries dependencies resolver was improved and it can now handle cases such as described here.
  • Logs are colored based on the message type.
  • LogColor keyword - Similar to Log. The message will be displayed in the IDE with the specified color.
  • Screenshot tool improved.
  • HttpUtils2 and DateUtils are now included as libraries in the IDE.
  • Bug fixes and other minor improvements (including "run last deployment" feature).

Version 2.71 is now available for download from the same link as v2.70. This update fixes the following issues:
  • Low quality images when adding images with the designer
  • CallSub casing fails with some numeric types
  • Support for the new location of aapt.exe
  • Other minor improvements
 

geewiztech

Member
Licensed User
Longtime User
I downloaded it this afternoon and find that it is indeed a great update.
Can't wait for tomorrow and see if the new bitmap handling solves some issues I was having with OOM errors in the app I'm developing at work.

However, there is a new behaviour in the IDE that I find quite annoying. It now scrolls the visible text up or down to the place where the cursor is. I often like to scroll up and down to see other pieces of code without changing the place the "text cursor" is.

I guess it comes from the new complier warning engine. Is there a way to turn it (momentarily) off?

Thanks to Erel for this great (as all) new version,

Julio

I would like this option as well.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
However, there is a new behaviour in the IDE that I find quite annoying. It now scrolls the visible text up or down to the place where the cursor is. I often like to scroll up and down to see other pieces of code without changing the place the "text cursor" is.
Does it scroll automatically? It shouldn't. Make sure that your project doesn't include a class that is also available in a referenced library.
 
Upvote 0

JCO

Active Member
Licensed User
Longtime User
Does it scroll automatically? It shouldn't. Make sure that your project doesn't include a class that is also available in a referenced library.

That seems to be it... I am using the httputils2service, which is now a library. If I unload the new HttpUtils2 lib, the behavior changes back!

Thanks,

Julio
 
Upvote 0

cmastran

Member
Licensed User
Longtime User
Additional Desirable Improvements for B4A

Hello Erel,

Thank you for the great improvements to V 2.70. I would like you to consider adding the following features:

1. Add Multiple Log tabs (ie: Log1, Log2, etc ). It is difficult o debug the program when all log info is directed to one file

2. Ability to cut and past Log text with mouse button. Right now I can copy the entire log or the visible window. Cutting and pasting with the mouse is much more useful.

3. An easy way to wait for event completion. Sometimes we want to wait for a file to be downloaded or uploaded before moving on to the next of the program. This is very difficult to program now.

Thank You !
 
Upvote 0

touchsquid

Active Member
Licensed User
Longtime User
Hi Erel,

Lots of excellent features, unfortunately we still get not intialized errors on buttons that have been initialized.

It crashes on b = sender, the second time this sub is used. The first time works. The sub works fine in version 2.52.

Sub SetupMenu_Click
If ClickEvent Then Return
DoEvents: ProgressDialogShow(Common.Language.Phrase("Wait")): DoEvents
Dim B As Button: Dim T As String: B = Sender: T = B.Tag
Select T
Case "New", "Existing"
If Common.CurrentProfile.IsSaved OR Not(Common.CurrentProfile.GetDeviceConfigured(1)) Then
If T = "Existing" Then
ProgressDialogHide: DoEvents
LoadProfileReturnState = "SetupMenu": LoadProfileGotoState = "Devices"
GotoState("LoadProfile"): IgnoreCMD = False: Return
Else
Common.CurrentProfile.Initialize("New"): GetLanguage: GotoState("Devices")
End If
Else
Dim Result As Int: Result = Msgbox2(Common.Language.Phrase("Action?"), Common.Language.Phrase("CurrentUnsaved"), Common.Language.Phrase("SaveCurrent"), Common.Language.Phrase("EditCurrentProfile"), Common.Language.Phrase("DiscardCurrent"), Null)
If Result = DialogResponse.POSITIVE Then GotoState("SaveProfile")
If Result = DialogResponse.CANCEL Then GotoState("Activities")
If Result = DialogResponse.NEGATIVE Then
If T = "Existing" Then
ProgressDialogHide: DoEvents
LoadProfileReturnState = "SetupMenu": LoadProfileGotoState = "Devices"
GotoState("LoadProfile"): IgnoreCMD = False: Return
Else
Common.CurrentProfile.Initialize("New"): GetLanguage: GotoState("Devices")
End If
End If
End If
Case "Current"
If Not(Common.CurrentProfile.GetDeviceConfigured(1)) OR Not(Common.CurrentProfile.GetActivityPartial(1)) Then
GotoState("Devices")
Else
GotoState("Activities")
End If
Case "Advanced"
GotoState("ProfileView")
Case "Save"
GotoState("SaveProfile")
Case "Language"
GetLanguage
Case "Exit"
If Not(Common.CurrentProfile.DeviceConfigured(1)) OR Not(Common.CurrentProfile.GetActivityConfigured(1)) Then
IgnoreCMD = False: ProgressDialogHide: Activity.Finish ' ***
End If
Common.CurrentWatchMode = -1: Ini.WatchMode = Common.CurrentWatchMode: Ini.SaveIni
DBase.UnloadDB: DBLoaded = False: SetupMode = False
GotoState("Splash")
End Select
ProgressDialogHide: DoEvents
IgnoreCMD = False
End Sub
 
Upvote 0

ValDog

Active Member
Licensed User
Longtime User
This seems quirky - I updated to this release and now cannot see the spinners on any of my dialogs when using the Designer - neither in the Emulator nor on my Nexus 7. They do show up in my compiled program however. Does anyone have a clue?
 
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User
Quote: Compiler warnings list should have a selected bar as it is for other such as log, so that we can see where the selection is.

Not sure that I understand. You can click on any item to jump to the relevant code line.

I see this as a problem too - when I click on a warning it takes me to the offending line in the code, which is great. I fix it, and then want to go back to the warnings, but I can't tell where I had last clicked in the warnings log. Highlighting the clicked line in the warnings log would solve this.
 
Upvote 0

alfcen

Well-Known Member
Licensed User
Longtime User
Words of Praise

The compiler before Ver 2.7 did already a great job catching up errors.
The new warning engine since 2.7 does not only make it fool-proof, but also
helps optimize code and motivates coding discipline (educational value).

Couldn't believe how many useless variables I overlooked in my endless code -
how many missing declaration types. Well, the apps did work before, but
now they are more robust and without overheads.

In brief, thank you Erel and your team so very much for this update.
You are always concentrating on the most essential and helpful functions.

Maybe, someday, B4A will no longer require programming knowledge.
 
Upvote 0

iac249

New Member
Licensed User
Longtime User
Hi,
I opened the class-example draw.zip in B4A 2.7.0. I encounter references to "Me" like
B4X:
Shapes.Add(Me)
Could somebody give me a hint what "Me" means? Goggling for "Me b4a" seems not very helpful.
Thanks, positrom2

As in Visual Basic, "Me" is the self-reference of an object.
 
Upvote 0

Eugene

New Member
Licensed User
Longtime User
Compile To Library - activity context for code modules

First of all thanks a lot for thе great job you are doing guys!
For the time I'm following the project it become serious and competitive product on the market. Of course as any other software it is containing some bugs and glitches but taking on account the speed of IDE development they are just amaizingly nominal.

Perhaps I missed something but why Compile To Library option is always creating the library for activity context?

Below is XML file content from my test library compiled from the fresh installation of B4A 2.7. The library is containing just one code module - it's why I'm not understanding why <owner> tag is set as activity?

As the result I cannot use static functions from this library in other B4A modules wich has process context unless:
1. I set dummy activity object in module's globals which is not always good
2. Or edit XML file manually replacing owner with process (or using #CustomBuildAction with utility which will do the same each time after library compilation)

HTML:
<?xml version="1.0" encoding="UTF-8"?>
-<root> <doclet-version-NOT-library-version>1.00</doclet-version-NOT-library-version> -<class b4a_type="StaticCode"> <name>b4a.example.func2</name> <shortname>Func2</shortname> <owner>activity</owner> <objectwrapper>java.lang.Class</objectwrapper> -<method> <name DesignerName="IsWorking">_isworking</name> <returntype>boolean</returntype> -<parameter> <name>ba</name> <type>anywheresoftware.b4a.BA</type> </parameter> </method> -<method> <name DesignerName="Process_Globals">_process_globals</name> <returntype>String</returntype> </method> </class> <version>1</version> <author>Eugene</author> </root>
 
Upvote 0
Top