Basic4android v2.20 BETA is released

Erel

B4X founder
Staff member
Licensed User
Longtime User
I'm happy to release v2.20 beta to the beta testers.

This version includes the following improvements:
  • For Each blocks
  • Declaration and assignment in the same statement - Two new language features in the next version
  • B4A-Bridge - many stability improvements related to both Bluetooth mode and wireless mode
  • B4A-Bridge supports logging on all devices including Android 4.1+. Requires B4A-Bridge 2.07
  • Menu items will now appear in the action bar on Android 3.0+ devices
  • Default target level set to 14
  • WYSIWYG designer uses device default theme. Supports changing themes: New feature: better support for modern Android themes
  • Designer includes a new color value: DEFAULT. The meaning of this value is that the theme default color will be used.
  • Designer script new keywords make it easier to build user interfaces that scale correctly on all phones and tablets: Min, Max, AutoScale, AutoScaleAll and AutoScaleRate: New feature: AutoScale and other new designer script keywords
  • Optimized designer layout files - loading time is 3 - 4 times faster
  • MediaPlayer can play files from File.DirInternal
  • Map.Keys / Values - allows iterating over map entries with For Each
  • Panel / Activity.RemoveAllViews
  • LayoutValues.ApproximateScreenSize - returns the approximate device physical screen size
  • Sign key alias key can be changed (requires editing the settings file)
  • Activity/Panel.LoadLayout can now be used from classes
  • Camera_Preview event

Many bugs were fixed including:
  • Recycle error in ListView_ItemClick event
  • TabHost.AddTabWithIcon / AddTab - correctly calculate the width and height
  • Code documentation should be updated almost immediately
  • Upper casing of single letter variables
  • Memory leak when opening large projects
  • Non activity classes can call code modules
  • WYSIWYG Designer and B4A-Bridge listen to an alternative port if the main one is already bound.
  • Fixed debugger error related to complex objects with circular references

Notes
  • Layout files saved in the new version cannot be loaded on older versions of the IDE
  • Libraries in the internal libraries folder have first priority (changed from previous versions)
  • B4A.xml file was updated. If you are using a custom color scheme then you can copy the relevant section to the new file.

Beta testers, please backup your projects before loading them with the new version.

Existing beta testers should receive an email with installation instructions. If you want to join the beta testers then please send an email to erel@basic4ppc.com, note that the beta is only sent to users who are eligible to free upgrades.

Thank you for your help. Please post any feedback or question in this forum. Issues should be posted as new threads in this forum.
 

Roger Garstang

Well-Known Member
Licensed User
Longtime User
You cannot create a new activity object. You can however pass an activity object to a class.

So when in a class you can't access the current activity with the Activity keyword...other than passing it to it? Does that mean the Class creates its own Activity on its own and not the same as the Activity the class is calling from?
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
Error with Types?

@ Erel,

I believe there is still an issue with Types in the latest version 2.14 Beta. I have code that will not complie in the last Beta(I just downloaded the latest). I think it is the Type declarations below that are causing the problem.

B4X:
Type DirectionsStepType(Distance As DistanceType, Duration As DurationType, EndLocation As LatLngType, Instructions As String, Path() As LatLngType, StartLocation As LatLngType, TravelMode As String)
Type DistanceType(Text As String, Value As Int)
Type DurationType(Text As String, Value As Int)
Type LatLngType(Latitude As Double, Longitude As Double)

Below is the text I get:

src\ADR\ABP\KF\directionsleg.java:37: illegal start of expression
Path = = new directionsleg._latlntyype[0];

Note: src\ADR\ABP\KF\directionsleg.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

It does compile under B4A 2.02 and works fine. I thought you should see this.

Thanks,

Margret
 
Upvote 0

Roger Garstang

Well-Known Member
Licensed User
Longtime User
For the first time since the Beta was released I had my Tooltips for my Class Methods not show my comments. I don't know if anything changed in the last iteration or if I just ran it long enough to hit some type of memory usage or part of the code that causes the issue. Just wanting to let you know. It was doing good showing them up until then.
 
Upvote 0

eps

Expert
Licensed User
Longtime User
Did anyone else have the link to their developer key lost when they upgraded? I had to reinstate mine, but it might just have been because I was using a new development rig and it wasn't saved properly.
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
@ Erel,

Thank you for the lastest download which did correct the Array Types issue in Classes.

One other thing I have noticed. The self documention I have put in the class code does not always show. As I am working and building the class, when I go to look at the functions, the docs will not show up until I save and then reload the project. Every once in a while they will show up by saving but most times I have to reload the project. This was also the case in 2.02. Just wanted to make sure you know it is still doing this.
 
Upvote 0

Roger Garstang

Well-Known Member
Licensed User
Longtime User
Mine still had the documentation issue Margret mentioned too, although not as bad as before the beta. It did do it in both the list that pops up and in the tooltip that is there when typing function parameters. It may just be how I use it, but it did seem to do it more while typing parameters than in the list, but I don't use it as much in the list and just insert the function...I need it most when typing parameters.
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
@ Erel,

If I write a class called MyClass then in the Activity I say:

Dim MV as MyClass

then I type:

MV.

The list that comes up will not show the last changes I made in the class and most times only shows one line which is the function and parameters. Re-saving most times makes no change and I have to reload the project. This is mainly as I am writing code and making changes to the class. So, if I reload and it's all working then I add a new function in the class code and save it. Either that functions docs does not show in the list or we are back to the one line of function name and parameters and the other docs are missing.
 
Last edited:
Upvote 0

Roger Garstang

Well-Known Member
Licensed User
Longtime User
I agree, however this is how Android is designed. If your device has a physical menu button then the three dots will not appear.

You will need to add the often used items first. There is no other priority.

Started teaching myself Android Development in Eclipse due to the need for more advanced options in my main application, and found there was a way to put priority and even whether or not to show items up there at all. Was just about to comment over the weekend then saw that a new version was released adding it. Better Camera control and I probably would have continued to fight it out. I knew a little JAVA and develop in C#, so it isn't as bad as I thought it would be. Once I get a little better I may write some plugins for B4A to do the things that were missing.
 
Upvote 0

Eduard

Active Member
Licensed User
Longtime User

If I add several menu item with the following code
B4X:
Activity.AddMenuItem2("A","A",bm1)
Activity.AddMenuItem2("A","A",bm1)
Activity.AddMenuItem2("A","A",bm1)
Activity.AddMenuItem2("A","A",bm1)
Activity.AddMenuItem2("A","A",bm1)

I get an action bar om my device, with 2 items but no overflow button. The remaining 3 items are available onder the menu button. I can't figure out what's wrong.

How can I get the overflowbutton to appear and work?


Edit:

Sorry. The answer is already given :

If your device has a physical menu button then the three dots will not appear.

Is there a way to work around this? Can I for example disable the 'physical' menu button? I can add an overflow button myself + panel with al the other menu items. But the problem is that the overflow button must be in the top right. It will be the first button to be moved to the physical menu if there is no space.
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…