Erel B4X founder Staff member Licensed User Longtime User Jun 19, 2012 #1 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.
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.
T tpakis Active Member Licensed User Longtime User Jun 26, 2012 #61 klaus said: Sure you can ! I have always the previous version(s) available in paralel. Just don't forget to copy the license file to the new folder. Best regards. Click to expand... Thank you for your answer! Upvote 0
klaus said: Sure you can ! I have always the previous version(s) available in paralel. Just don't forget to copy the license file to the new folder. Best regards. Click to expand... Thank you for your answer!
rayzrocket Member Licensed User Longtime User Jun 26, 2012 #62 Ver1.70 is very code fault tolerant than Ver2.00 B4A Ver2.00, Bravo Erel! This may help some of those struggling with debugging code after Ver2.00 update. Ver1.7 sometimes(everytime in my cases) allows "CallSub" into paused activities. 2.0 will not tolerate this!, the app will run, but consistently break down, stop functioning, error, or crash the phone whenever a "CallSub" is made into a paused activity (this goes for both activities and service modules). It is very hard to debug via app runtime. Upvote 0
Ver1.70 is very code fault tolerant than Ver2.00 B4A Ver2.00, Bravo Erel! This may help some of those struggling with debugging code after Ver2.00 update. Ver1.7 sometimes(everytime in my cases) allows "CallSub" into paused activities. 2.0 will not tolerate this!, the app will run, but consistently break down, stop functioning, error, or crash the phone whenever a "CallSub" is made into a paused activity (this goes for both activities and service modules). It is very hard to debug via app runtime.
kanaida Active Member Licensed User Longtime User Jun 27, 2012 #63 Thanks guys!! I can't wait to try this tonight! can't believe I missed the original email and didn't see it till today Writing stuff without classes felt like I was a pirate with a wooden leg and a missing eye lol It's not that you can't win a fight, but... it's just easier if you're a ninja with all your limbs and 2 swords Upvote 0
Thanks guys!! I can't wait to try this tonight! can't believe I missed the original email and didn't see it till today Writing stuff without classes felt like I was a pirate with a wooden leg and a missing eye lol It's not that you can't win a fight, but... it's just easier if you're a ninja with all your limbs and 2 swords
P PeakW Member Licensed User Longtime User Jun 27, 2012 #64 For 2.0 was wrong I was running the program normal, B4A upgraded to 2.0, appear below error, please advise :sign0085: java.lang.NoSuchFieldError: anywheresoftware.b4a.BA.activityBA at anywheresoftware.b4a.agraham.reflection.Reflection.GetActivity(Reflection.java:638) at Sw.Tel.main._setshowwhenlocked(main.java:2589) at Sw.Tel.main._activity_create(main.java:357) at java.lang.reflect.Method.invokeNative(Native Method) Upvote 0
For 2.0 was wrong I was running the program normal, B4A upgraded to 2.0, appear below error, please advise :sign0085: java.lang.NoSuchFieldError: anywheresoftware.b4a.BA.activityBA at anywheresoftware.b4a.agraham.reflection.Reflection.GetActivity(Reflection.java:638) at Sw.Tel.main._setshowwhenlocked(main.java:2589) at Sw.Tel.main._activity_create(main.java:357) at java.lang.reflect.Method.invokeNative(Native Method)
Erel B4X founder Staff member Licensed User Longtime User Jun 27, 2012 #65 About the CallSub issue. There is a bug in v2.00 where CallSub fails instead of doing nothing when the activity is paused. Previously it just did nothing. This is fixed in the next update which will soon be available. Note that it is much better to use CallSubDelayed when interacting with other modules. @PeakW, you should download the latest Reflection library. It fixes this issue (see the first post here). Upvote 0
About the CallSub issue. There is a bug in v2.00 where CallSub fails instead of doing nothing when the activity is paused. Previously it just did nothing. This is fixed in the next update which will soon be available. Note that it is much better to use CallSubDelayed when interacting with other modules. @PeakW, you should download the latest Reflection library. It fixes this issue (see the first post here).
T trisium Member Licensed User Longtime User Jun 27, 2012 #67 problems with existing projects after installing v2.00 After installing version 2.0 (updating version 1.9) I get problems with my existing projects (working fine on version 1.9). Opening an project produces this message: "An error occured. Der Verzeichnisname ist ungültig." I think this happens in the context with Java??? Compiling the project results in this message: "Compiling code. 0.77 Compiling layouts code. 0.06 Generating R file. 0.02 Compiling generated Java code. Error Der Verzeichnisname ist ungültig" I use no additional libraries and I have no idea, which folder name is meant... Reinstalling 1.9 solves the problems... What could be the solution? :sign0085: Thanks! Upvote 0
problems with existing projects after installing v2.00 After installing version 2.0 (updating version 1.9) I get problems with my existing projects (working fine on version 1.9). Opening an project produces this message: "An error occured. Der Verzeichnisname ist ungültig." I think this happens in the context with Java??? Compiling the project results in this message: "Compiling code. 0.77 Compiling layouts code. 0.06 Generating R file. 0.02 Compiling generated Java code. Error Der Verzeichnisname ist ungültig" I use no additional libraries and I have no idea, which folder name is meant... Reinstalling 1.9 solves the problems... What could be the solution? :sign0085: Thanks!
klaus Expert Licensed User Longtime User Jun 27, 2012 #68 Look in IDE menu Tools / Configure Paths and check that there are no spaces nor any other special character in the file names. Best regards. Upvote 0
Look in IDE menu Tools / Configure Paths and check that there are no spaces nor any other special character in the file names. Best regards.
T trisium Member Licensed User Longtime User Jun 27, 2012 #69 klaus said: Look in IDE menu Tools / Configure Paths and check that there are no spaces nor any other special character in the file names. Best regards. Click to expand... Thanks a lot Klaus, but I see no problems at this place - the paths are: D:\Java\jdk1.7.0\bin\javac.exe D:\Android\android-sdk\platforms\android-14\android.jar Both paths/files exist - and work fine with version 1.9. I would be happy about other hints!!! Upvote 0
klaus said: Look in IDE menu Tools / Configure Paths and check that there are no spaces nor any other special character in the file names. Best regards. Click to expand... Thanks a lot Klaus, but I see no problems at this place - the paths are: D:\Java\jdk1.7.0\bin\javac.exe D:\Android\android-sdk\platforms\android-14\android.jar Both paths/files exist - and work fine with version 1.9. I would be happy about other hints!!!
klaus Expert Licensed User Longtime User Jun 27, 2012 #70 You could try perhaps menu Tools / Clean Project Not sure if this will solve the problem. Best regards. Upvote 0
You could try perhaps menu Tools / Clean Project Not sure if this will solve the problem. Best regards.
Erel B4X founder Staff member Licensed User Longtime User Jun 27, 2012 #71 Does your project folder include any spaces? Upvote 0
T trisium Member Licensed User Longtime User Jun 27, 2012 #72 klaus said: You could try perhaps menu Tools / Clean Project Not sure if this will solve the problem. Best regards. Click to expand... Thanks again, Klaus, unfortunately without effect :-( The error occurs while "generating R file" - perhaps knowing more about this part of compiling procedure would help, but I'm not familiar with this... Additionally the message appears in German... Any other ideas? Best regards. Upvote 0
klaus said: You could try perhaps menu Tools / Clean Project Not sure if this will solve the problem. Best regards. Click to expand... Thanks again, Klaus, unfortunately without effect :-( The error occurs while "generating R file" - perhaps knowing more about this part of compiling procedure would help, but I'm not familiar with this... Additionally the message appears in German... Any other ideas? Best regards.
T trisium Member Licensed User Longtime User Jun 27, 2012 #73 Erel said: Does your project folder include any spaces? Click to expand... Many thanks, Erel, this seems to be the solution - but why did it work in 1.9 with spaces...??? Anyway, I'm able to continue my work! Thanks again! Upvote 0
Erel said: Does your project folder include any spaces? Click to expand... Many thanks, Erel, this seems to be the solution - but why did it work in 1.9 with spaces...??? Anyway, I'm able to continue my work! Thanks again!
margret Well-Known Member Licensed User Longtime User Jun 27, 2012 #74 Is there or is it in the works, a version above B4A 2.0? I have seen some comments and don't remember where that an update to 2.0 is coming that will fix some issues with HttpUtils. Is this correct? Upvote 0
Is there or is it in the works, a version above B4A 2.0? I have seen some comments and don't remember where that an update to 2.0 is coming that will fix some issues with HttpUtils. Is this correct?
kanaida Active Member Licensed User Longtime User Jun 27, 2012 #75 Timers in classes Hey Erel, just tried creating a simple project. It's mostly just one class 'Car'. It's got a timer inside, when the Car.StartEngine() is run, it changes the color of it's internal view every second. (it's just a box right now lol) I put the timer in there just to see if it could animate independently of what my activity was doing, so by changing an interval or variable like speed, the wheels would animate faster or slower. I got a nasty log message after the first tick though... Code: [Common.java:153:Log()] ** Activity (main) Create, isFirst = true ** [Common.java:153:Log()] Mitsubishi [Common.java:153:Log()] Eclipse [Common.java:153:Log()] Engine started!!! [Common.java:153:Log()] 0,0 [Common.java:153:Log()] ** Activity (main) Resume ** [BA.java:93:uncaughtException()] java.lang.NullPointerException at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:102) at android.os.Handler.handleCallback(Handler.java:587) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3694) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:895) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:653) at dalvik.system.NativeStart.main(Native Method) [Common.java:153:Log()] ** Activity (main) Resume ** Car Class: Code: 'Class module Sub Class_Globals Dim Make As String Dim Model As String Dim Position As pos : Position.Initialize(0,0) Dim V As ImageView : V.Initialize("v") : V.Color = Colors.Red Dim t As Timer Dim Frame As Int : Frame = 0 End Sub 'Initializes the object. You can add parameters to this method if needed. Public Sub Initialize(Make_ As String, Model_ As String) Make = Make_ Model = Model_ End Sub Public Sub StartEngine Log("Engine started!!!") Log(Position.x & "," & Position.y) t.Interval = 1000 t.Enabled = True End Sub Public Sub v_ItemClick() Log("View Clicked!") End Sub Public Sub t_Tick If Frame > 3 Then Frame = 0 End If Select Case Frame Case 0 V.Color = Colors.green Case 1 V.Color = Colors.yellow Case 2 V.Color = Colors.Magenta Case 3 V.Color = Colors.White End Select End Sub Pos (position) class: Code: 'Class module Sub Class_Globals Dim x As Int Dim y As Int End Sub 'Initializes the object. You can add parameters to this method if needed. Public Sub Initialize(x_ As Int,y_ As Int) x = x_ y = y_ End Sub Main: Code: Dim c As Car : c.Initialize("Mitsubishi","Eclipse") Log(c.Make) Log(c.Model) c.StartEngine Activity.AddView(c.V,0,0,64,64) Upvote 0
Timers in classes Hey Erel, just tried creating a simple project. It's mostly just one class 'Car'. It's got a timer inside, when the Car.StartEngine() is run, it changes the color of it's internal view every second. (it's just a box right now lol) I put the timer in there just to see if it could animate independently of what my activity was doing, so by changing an interval or variable like speed, the wheels would animate faster or slower. I got a nasty log message after the first tick though... Code: [Common.java:153:Log()] ** Activity (main) Create, isFirst = true ** [Common.java:153:Log()] Mitsubishi [Common.java:153:Log()] Eclipse [Common.java:153:Log()] Engine started!!! [Common.java:153:Log()] 0,0 [Common.java:153:Log()] ** Activity (main) Resume ** [BA.java:93:uncaughtException()] java.lang.NullPointerException at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:102) at android.os.Handler.handleCallback(Handler.java:587) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3694) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:895) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:653) at dalvik.system.NativeStart.main(Native Method) [Common.java:153:Log()] ** Activity (main) Resume ** Car Class: Code: 'Class module Sub Class_Globals Dim Make As String Dim Model As String Dim Position As pos : Position.Initialize(0,0) Dim V As ImageView : V.Initialize("v") : V.Color = Colors.Red Dim t As Timer Dim Frame As Int : Frame = 0 End Sub 'Initializes the object. You can add parameters to this method if needed. Public Sub Initialize(Make_ As String, Model_ As String) Make = Make_ Model = Model_ End Sub Public Sub StartEngine Log("Engine started!!!") Log(Position.x & "," & Position.y) t.Interval = 1000 t.Enabled = True End Sub Public Sub v_ItemClick() Log("View Clicked!") End Sub Public Sub t_Tick If Frame > 3 Then Frame = 0 End If Select Case Frame Case 0 V.Color = Colors.green Case 1 V.Color = Colors.yellow Case 2 V.Color = Colors.Magenta Case 3 V.Color = Colors.White End Select End Sub Pos (position) class: Code: 'Class module Sub Class_Globals Dim x As Int Dim y As Int End Sub 'Initializes the object. You can add parameters to this method if needed. Public Sub Initialize(x_ As Int,y_ As Int) x = x_ y = y_ End Sub Main: Code: Dim c As Car : c.Initialize("Mitsubishi","Eclipse") Log(c.Make) Log(c.Model) c.StartEngine Activity.AddView(c.V,0,0,64,64)
kanaida Active Member Licensed User Longtime User Jun 27, 2012 #76 Nevermind.. My fault. forgot to initialize the timer first. It threw me off because the event looked as if it fired from looking at the log. Upvote 0
Nevermind.. My fault. forgot to initialize the timer first. It threw me off because the event looked as if it fired from looking at the log.
Kevin Well-Known Member Licensed User Longtime User Jun 28, 2012 #77 margret said: Is there or is it in the works, a version above B4A 2.0? I have seen some comments and don't remember where that an update to 2.0 is coming that will fix some issues with HttpUtils. Is this correct? Click to expand... I can't remember which thread it was in, but I think Erel mentioned 2.01 (to be considered a BETA) that is available at the previous download link provided when 2.0 came out. I think he also mentioned that 2.02(?) would be released soon. Edit: See my other post here. Last edited: Jun 28, 2012 Upvote 0
margret said: Is there or is it in the works, a version above B4A 2.0? I have seen some comments and don't remember where that an update to 2.0 is coming that will fix some issues with HttpUtils. Is this correct? Click to expand... I can't remember which thread it was in, but I think Erel mentioned 2.01 (to be considered a BETA) that is available at the previous download link provided when 2.0 came out. I think he also mentioned that 2.02(?) would be released soon. Edit: See my other post here.
margret Well-Known Member Licensed User Longtime User Jun 28, 2012 #78 Thank you very much Kevin Upvote 0
eps Expert Licensed User Longtime User Jun 28, 2012 #79 Tip top! Have made the jump, but will look out for 2.0.2! After an initial quick trial last night it seems good. The compiler checking is a little tighter, which is always a good thing! Upvote 0
Tip top! Have made the jump, but will look out for 2.0.2! After an initial quick trial last night it seems good. The compiler checking is a little tighter, which is always a good thing!
N newSteve Member Licensed User Longtime User Jul 2, 2012 #80 Same situation I finally upgraded to 2.0, tried my existing working project, and got the same thing. Did you ever get an answer? billmoultrie said: Just downloaded and now find all my apps, have the following problem when I compile. Code: Compiling code. 0.48 Compiling layouts code. 0.02 Generating R file. 0.00 Compiling generated Java code. Error javac 1.6.0_29 src\anywheresoftware\b4a\popping\main.java:54: cannot find symbol symbol : variable sharedProcessBA location: class anywheresoftware.b4a.BA processBA.sharedProcessBA.activityBA = null; ^ 1 error Click to expand... Upvote 0
Same situation I finally upgraded to 2.0, tried my existing working project, and got the same thing. Did you ever get an answer? billmoultrie said: Just downloaded and now find all my apps, have the following problem when I compile. Code: Compiling code. 0.48 Compiling layouts code. 0.02 Generating R file. 0.00 Compiling generated Java code. Error javac 1.6.0_29 src\anywheresoftware\b4a\popping\main.java:54: cannot find symbol symbol : variable sharedProcessBA location: class anywheresoftware.b4a.BA processBA.sharedProcessBA.activityBA = null; ^ 1 error Click to expand...