I'm happy to release the first beta of Basic4android v3.50. This update brings major improvements to the debugging features of Basic4android.
With this update you can enjoy the rapidness and power of the rapid debugger with runtime performance close to non-debug deployments.
A new powerful watch expression feature is also available:
This allows you to easily evaluate expressions when the debugger is paused.
New features and improvements:
Rapid debugger runtime performance is now close to non-debugged applications.
Watch Expressions feature (see screenshot above).
The rapid debuggers uses a virtual assets folder. This makes it possible to redeploy only the modified files. This feature makes deployments of large projects with many files much faster.
Visual designer - Views tree performance is significantly better. Views preserve their names when pasting views between layouts.
#AdditionalRes attribute can be used multiple times.
ScrollView.ScrollToNow method (available in HorizontalScrollView as well). Immediately scrolls the ScrollView to the new position.
Quick Search tool (Ctrl + I) - An index based search tool for quick searching (in all modules):
Regions were added to the Find Sub (Ctrl + E) tool.
New attributes: #DebuggerForceFullDeployment and #DebuggerForceStandardAssets.
Other minor improvements and bug fixes.
This is a beta version. Make sure to backup your projects before loading them with the new version.
Beta testers, please post any issue you find in a new thread in the questions forum.
I have a Program that has an ImageView added in the Designer.
In the debug legacy it compiles and installs OK.
In the Debug Rapid it throws errors mentioning the Initializing of the ImageView.
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
Copying updated assets files (1)
** Activity (main) Create, isFirst = true **
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.DynamicBuilder.build(DynamicBuilder.java:21)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:324)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:404)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:404)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:142)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:208)
at betpax.mydutchbet.main._activity_create(main.java:437)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:633)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:301)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:237)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:116)
at betpax.mydutchbet.main.afterFirstLayout(main.java:98)
at betpax.mydutchbet.main.access$100(main.java:16)
at betpax.mydutchbet.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3683)
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:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Error loading bitmap.
at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize2(CanvasWrapper.java:521)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize(CanvasWrapper.java:499)
at anywheresoftware.b4a.objects.drawable.BitmapDrawable.build(BitmapDrawable.java:69)
at anywheresoftware.b4a.objects.ImageViewWrapper.setImage(ImageViewWrapper.java:90)
at anywheresoftware.b4a.objects.ImageViewWrapper.build(ImageViewWrapper.java:113)
... 29 more
Error occurred on line: 46 (main)
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (ImageView).
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:208)
at betpax.mydutchbet.main._activity_create(main.java:437)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:633)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:301)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:237)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:116)
at betpax.mydutchbet.main.afterFirstLayout(main.java:98)
at betpax.mydutchbet.main.access$100(main.java:16)
at betpax.mydutchbet.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3683)
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:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Object should first be initialized (ImageView).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:46)
at anywheresoftware.b4a.objects.ViewWrapper.innerInitialize(ViewWrapper.java:59)
at anywheresoftware.b4a.objects.ImageViewWrapper.innerInitialize(ImageViewWrapper.java:35)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:385)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:404)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:404)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:142)
... 22 more
** Activity (main) Resume **
I'm sure this is because of my own screen layout - Old XP - but it would be nice to see in another background colour.
The lighter Blue in the Quick Search for example.
since it's a beta release it would be better to keep it in a separate directory and not to use in production while waiting for the final release, I guess...
Hello @Erel ,
I've just thought I would try Debug(Rapid) in B4A 3.5. This is happening with my widgets. Debug(Legacy) and the two release modes work perfectly. Also I have noticed that Convert byte code - optimized dex is slower on my i7. But that could be the fact that I've just updated the AdMob to V2 with libraries, #AdditionalRes etc.
When I use rapid debugger, I`m getting an error: Specified argument was out of the range of valid values. Parameter name: index.
It happens just after the device and ide connect. Seems that stepping through each line with f8 is ok, but not if I just let it run.
I don`t use "index" in my code so I`m guessing its not something I`ve done - and I only got this since the update to 3.5beta.
I will check the widgets issue. Note that you should test widgets in Release mode because widgets can start the process by themselves after it is killed.
The slowdown you see is related to AdMob 2 which depends on Google Play Services. This is a large library.
Watch Expressions allow you to evaluate expressions. It is not possible reevaluate the expressions on each line as it will make the program very slow.
The problem is that when you're trying to evaluate why something has changed, it does no good when a value flashes so fast you can't see it change. You need to be able to stop execution when a value changes... or not. You need to have the program stop in debugging mode when that value that you're watching changes. That's why you're watching it in the first place. I know this is a tall order, but that's the reality.
EDIT: Maybe I spoke too soon. It is generally faster & less laggy, but I have also seen some unexplained (& un-logged) crashes of my app - usually when applying code changes during a debug session, or on a full restart after a code change. I also saw some freezing (sometimes before a crash). None of these events occurred when I switched back to Legacy Debug mode. Sorry the descriptions are a bit vague, but there was no error logging & I haven't spent any time trying to reproduce any issues...
Thanks Erel. The Rapid Debugger seems much, much faster than it was in the first release. It was so laggy before that I couldn't even use it to test Yahtzee!, but now it's great. There is a tiny amount of intermittent lag, but it's almost as good as running it in Legacy Debug or Release mode. Good job!
I've created new, clean project:
add a service module:
add layout "layout2"
(add widget)
(no breackpoints setted, nothig.....)
B4X:
#Region Service Attributes
#StartAtBoot: False
#End Region
Sub Process_Globals
Dim rv As RemoteViews
End Sub
Sub Service_Create
rv = ConfigureHomeWidget("layout2", "rv", 0, "Widget Name")
End Sub
Sub Service_Start (StartingIntent As Intent)
If rv.HandleWidgetEvents(StartingIntent) Then Return
End Sub
Sub rv_RequestUpdate
rv.UpdateWidget
End Sub
Sub rv_Disabled
StopService("")
End Sub
Sub Service_Destroy
End Sub
compile ok, only in rapid debug, I receive this error:
B4X:
Parsing code. 0.00
Compiling code. Error
Error compiling program.
Error description: CreateRemoteViews can only be called once per Service.
Occurred on line: 10
rv = ConfigureHomeWidget("layout2", "rv", 0, "Widget Name")
Word: configurehomewidget
I think it is a bug on 3.50 beta, no problem to compile in rapid debug identical project with 3.2!
I cannot test the rapid debug features, becouse on my few projects there are widgets.