Debugging Dynamix 1 Plug-ins

//Debugging Dynamix 1 Plug-ins
Debugging Dynamix 1 Plug-ins 2017-09-29T23:38:59+00:00
Special thanks to Max Pagel for providing this guide.

How to set up Debugging for your Dynamix Plugin

Unfortunately debugging your Dynamix Plugin is not as easy as debugging conventional applications or normal Android apps on your phone. The reason for this lies in the fact that your plugin is not started as an application but rather is loaded dynamically via the OSGI context on your Phone or your emulator. Therefore eclipse or other IDEs don’t have a dedicated point to attach their debugger to. However fortunately Android provides some great debuging possibilities through the “Dalvik Debug Monitor Server” (DDMS) system that enabls dynamix plug-in debugging. To enable plug-in debugging we will have to establish a remote debugging connection to the dynamix core framework running on the device or the emulator. This tutorial describes how to achieve this using eclipse, but it is possible with any IDE that supports remote debugging.

1. Click on the debugging icon in the menu bar and select “debug configurations”

step1

2. In the following window, double click on “Remote Java Application” in the selection menu on the left to create a new debug configuration and give it a name – “Dynamix Core” in our case here. Make sure to leave the Project field empty, as we are not associating this configuration with a specific project inside eclipse. However, if you have the Dynmix core Framework project set up in eclipse, you can enter it in the Project field to be able to debug inside the Dynamix core as well.

step2

3. Click on the Source tab of the window. Click on “add” and select “project”. Check the plug-in projects you want to debug, e.g. the “BatteryLevelPlugin” in our case and click ok. Click apply.

step3

4. Make sure Dynamix is running on your device or in the emulator. Open the DDMS perspective. You will see a list of devices on the left. Click the device you want to debug and you shoul see a list of running applications. Click on the “org.ambientdynamix.core” item. This is important, as only if you highlight it the debug output of Dynamix will be forwarded to port 8700 to which we will connect with our remote debugging configuration.

step4

5. That’s it, we are ready to debug! Set a breakpoint somewhere in your plug-in and go back to the debug configurations view from step 1. Select the “Dynamix Core” configuration and click “Debug”. This should connect you to the running Dynamix framework on the phone. To check if you are connected either open the debug perspective of eclipse or the debug view. You should see a “Dynamix Core

[Remote Java Application]” connection and the eclipse should halt the execution of your plugin code as soon as the control flow hits a breakpoint.

step5