Android Tutorial Rapid Debugger

Basic4android v3.0 includes a new debugger named rapid debugger.

SS-2013-10-01_09.57.39.png


The rapid debugger is a very sophisticated debugger with features not available in any other native Android development tool.

The rapid debugger is an important addition to Basic4android. It will increase your productivity as it makes the "write code -> test result" cycle much quicker.

Using this deployment mode is similar to using the standard debugger ("legacy" debugger).


Rapid Debugger advantages

  • Very quick compilation and installation. Usually in less than one or two seconds.
  • In most cases (after the first installation) there is no need to reinstall the APK. This means that the deployment is much quicker. With B4A-Bridge there is no need to approve the installation.
  • Hot code swapping (edit and continue). You can modify the code while the app runs, hit Save and the code will be updated.
  • Powerful variables browser:

    SS-2013-10-01_10.16.01.png
  • Watch Expressions (v3.50):

    SS-2014-02-23_14.48.37.png

    Allows you to evaluate expressions during breakpoints.
Limitations

  • The runtime execution in this mode is slower. In some cases it is slightly slower and in others it can be significantly slower. The rapid debugger is not suitable for debugging "real-time" games or CPU intensive tasks. This is why the legacy debugger is kept.
    Starting from v3.50 the runtime performance of the rapid debugger is close to Release mode.

  • Hot code swapping is very powerful. You can even add subs or modify existing subs. However you cannot add or remove global variables.
  • Unlike the legacy debugger, the app cannot run when the IDE is not connected. It will wait for 10 seconds for the IDE to connect and then exit.
 
Last edited:

ndnull

Member
Licensed User
Longtime User
Thanks for the Rapid debug feature! its been great in most respects, especially when tuning up code drawn objects in different device sizes. It makes me feel more like I'm working in Studio every day, and being able to read the locals is great during development. Rapid debug is an immense time saver.

I have only seen one error, in that I cant set a checkbox to be checked after being initialized without the code locking up.

>> draw a checkbox someplace and set it high

Dim CHKBX As CheckBox
CHKBX.Initialize ("completor")
CHKBX.Checked = True
CHKBX.text ="Click me if I run"


>> watch for the CheckChanged event on Activity draw...


Sub completor_CheckedChange(Checked As Boolean)

dim HappyResult as Boolean
HappyResult = Checked << cant get here, in rapid debug mode...

end sub




Other than that, its been most helpful in speeding the development process.
Keep up the great work!
 

ilan

Expert
Licensed User
Longtime User
the rapiddebugger is really great, would it be in the near future possible to use the rapid debugger via usb??
wifi is not working always if you are to far away from the router
 

ilan

Expert
Licensed User
Longtime User
how can i connect to the B4A Bridge via usb?? i have only connect via WIFI and connect via Bluetooth
i dont see connect via USB to B4A Bridge
 

boten

Active Member
Licensed User
Longtime User
Tried to run a small-medium app with Rapid debugger & Emulator. After 15 minutes emulator still shows "waiting for IDE...."
 

FrenchDeveloper

Member
Licensed User
Longtime User
Great job !
Sometimes, Rapid debugger stops with an IndexOutOfBounds error in activity_create sub (see attached file). With Legacy debug mode, I never have this problem. So, when it happens, I run in legacy mode then again in rapid mode. Then sometimes it works.
I use V3.0
 

Attachments

  • Error.png
    Error.png
    12 KB · Views: 309

nicodh

Member
Licensed User
Longtime User
Hello Erel, is there a max size limitation when using the rapid debuger? I'm having a crash with java saying that the code is too long for try.
This does not happen with the legacy denuger.
My app has a main with around 3000 lines

This is the error:
Parsing code. 0.45
Compiling code. 0.80
Compiling layouts code. 0.06
Generating R file. 1.14
Compiling debugger engine code. Error
B4A line: 2720
End Sub
javac 1.7.0_25
shell\src\nicodh\bgcConfig\main_subs_0.java:3312: error: code too large for try statement
catch (Exception e) {
^
1 error

Thanks
 

miguelconde

Member
Licensed User
Longtime User
Hello Erel, guy's

Today I installed version 3.50.
I first tried the "rapid debuger" and showed me the following error:
--------------------------------
"Parsing code. 0.94
Compiling code. 6.51
Compiling layouts code. 1.86
Generating R file. 7.18
Compiling debugger engine code. Error
B4A line: 2209
End Sub
javac 1.6.0_21
shell\src\sfanet\movil\sync_subs_0.java:6642: code too large for try statement
catch (Exception e) {
^
1 error"
------------------------------------

--> "Code too large for try statment"

In the other compile or debugin modes the error does not occur and generates the apk even perfectly.
The funny thing is that in the routine and line "2209" do not use a statement "try".
I can solve with other types of compilation, however but I could not enjoy "rapid debug".

Thank you
 
Top