Basic4android v2.00 is released!

Erel

B4X founder
Staff member
Licensed User
Longtime User
Basic4android v2.00 is now available. This upgrade is probably the most significant upgrade since v1.00.

The major new feature is support for class modules. With support for classes Basic4android now allows you to write both procedural code and object oriented code.
Object oriented code makes it easier to write and maintain large projects.

Basic4android v2.00 improvements:

- Classes

- Public and Private access modifiers

- Built-in documentation

- Better handling of tasks in the internal thread pool

- CallSubDelayed keywords - These keywords significantly simplify the interaction between services and activities.

- Building process improved and it now supports libraries with embedded resources (such as PayPal, Zooz, Samsung Pen and others).

- Bug fixes and other minor improvements.

Note that B4A.xml was modified in this version. The highlighting styles section was not modified.
The Reflection library was updated to support the new version internal changes.

V2.02 is now available. You should use the same link as the link to v2.00.
This version fixes several issues related to CallSub and CallSubDelayed keywords.
 

newSteve

Member
Licensed User
Longtime User
Same problem

Hi, I have the same problem after upgrading to 2.0. I checked the library in the libraries folder, and that is up to date. I looked in my configuration and the "additional libraries" box is blank, and says optional. Is there somewhere else I should look?


There are two possible locations for libraries. One is internal, in the location that Basic4android is installed and the other is configured under Tools - Configure Paths. In one of them you will find older version of these files.
 
Upvote 0

newSteve

Member
Licensed User
Longtime User
Problem after upgrade to 2.0

Sorry about the lack of details. I'm still getting used to how to reply to a particular post. Here's what I got (I replaced full path with "..."):

../main.java:54: cannot find symbol
symbol : variable activityBA
location: class anywheresoftware.b4a.BA
processBA.activityBA = null;
^
Note: ...\statemanager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

_______________________________

I may have missed some intermediate versions if that makes a difference.
 
Upvote 0

Kevin

Well-Known Member
Licensed User
Longtime User
Erel,

Any idea on the next official release date? I'm thinking of updating my app soon but may as well wait until the next release of B4A.
 
Upvote 0

salmander

Active Member
Licensed User
Longtime User
Wohooo cool.
Thanks Erel.
Does this solve the Tabhost problem in Android 4.0 that I mentioned in a post?
 
Upvote 0

newSteve

Member
Licensed User
Longtime User
Which error message do you get?

../main.java:54: cannot find symbol
symbol : variable activityBA
location: class anywheresoftware.b4a.BA
processBA.activityBA = null;
^
Note: ...\statemanager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

_______________________________

I may have missed some intermediate versions if that makes a difference.

newSteve
 
Upvote 0

newSteve

Member
Licensed User
Longtime User
 
Upvote 0

newSteve

Member
Licensed User
Longtime User
Make sure that there are no old copies of: Core.jar, Core.xml or BAShared.jar in your additional libraries folder.

I searched my hard drive for all three. Only one I fond was core.jar in a couple of non-b4a subfolders (netbeans, java) clearly not the same file; they were around 600-700k files.

Any other ideas/Is it safe to uninstall and reinstall 2.0?

-Steve
 
Upvote 0

newSteve

Member
Licensed User
Longtime User
resolved.

Sorry about this Erel, and anyone else. I was still running the old version somehow. I don't remember that the installation failed, but it is working now!

Thank you!

:sign0161:
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
I am having an issue that I can't find why it is giving an error: It is when I try to clear a variable dimmed as a list. This is in version 2.02. I can load this same code in 2.0 and it works fine. Any Ideas? The code is listed below:

B4X:
Sub chgname
   Dim lt, ans As Int
   Dim mycw As List
   mycw.Initialize
   lt = RecordCount
   For l = 0 To lt -1
      Pointer = l
      GetRecord   
      mycw = Regex.Split(" ", Field(0))
      If mycw.Size = 2 Then
         Field(0) = s.Trim(mycw.Get(1)) & ", " & s.Trim(mycw.Get(0))
         UpdateRecordNameSwap
      End If
      If mycw.Size = 3 Then
         Field(0) = s.Trim(mycw.Get(2)) & ", " & s.Trim(mycw.Get(0)) & " " & s.Trim(mycw.Get(1))
         UpdateRecordNameSwap
      End If
   Next
   Pointer = 0
   GetRecord
    mycw.Clear 'Throws an error - Java.lang.type
End Sub
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Any ideas on the above post?
Isn't regex.split supposed to return an array of strings, thus we should denote our list as an array, for e.g. dim myArray() and then myarray=regex.split(your stuff) ? Just a thought.

I've noticed that this coding doesn't produce an error:
B4X:
mycw.AddAll(Regex.Split(" ", Field(0)))
 
Last edited:
Upvote 0

agraham

Expert
Licensed User
Longtime User
It looks like a bug. Basic4android should convert the String array to a List. However it looks like it is converting to the wrong sort of list. A freshly initialised List is a "java.utils.ArrayList" but the automatic conversion produces a "java.util.Arrays$arrayList" which is not actually an ArrayList but a similarly named type that wraps an array in a List interface.

Arrays.asList() returning java.util.Arrays$ArrayList

One for Erel methinks!

EDIT :- I notice you say that it works in 2.00 for you. For me I get an UnsupportedOperationException in 2.00 - I haven't bothered installing 2.02.
 
Last edited:
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
Last edited:
Upvote 0

agraham

Expert
Licensed User
Longtime User
This List problem is not a cast but a conversion issue. The other problem you linked to is not really a problem at all. Because CallSub is an indirect call to a Sub specified by a string, that might actually be specified by a variable and not a literal, the compiler doesn't know the types of the parameters at compile time and so cannot coerce them if necessary. Therefore you need to pass the expected type to CallSub and its ilk.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…