Debug android-maven-plugin apps in Eclipse with DDMS

Lately, I’ve been developing Android applications with Maven support and, while it’s rather easy to mount a mature development environment with Eclipse, the usage of android-maven-plugin has brought some integration issues when debugging.

Usually, I do most of my Maven and debugging stuff in a terminal console. But others will prefer to use Eclipse! And I can understand why, since its DDMS perspective is so powerful and easy to use.  Here’s how you can do it:

  1. mvn clean package
  2. Deploy the target/xxx.apk to the device
  3. Open DDMS perspective in Eclipse
  4. Select the process you want to debug/trace
  5. There you go!

From profiling to thread debugging or simply adb logcat, you’ll have it all!

Don’t forget to configure permissions for your user to access the device. Ever hard those “?????” when issuing adb devices stating you have no permissions? Here’s how you can fix it (in Ubuntu-based distros at least):

  1. Run lsusb
  2. Check the line for your device, such as Bus 001 Device 008: ID 0bb4:0cab High Tech Computer Corp.
  3. Edit a new udev rule by executing sudo nano /etc/udev/rules.d/51-android.rules as seen bellow the bullet list
  4. Save file and issue sudo service udev restart
SUBSYSTEM==”usb”, SYSFS{idVendor}==”0bb4″, MODE=”0666
Reconnect your device and you’re done!

Debugging running APK in Eclipse DDMS


Xubuntu brought back the happy Linux user in me

I’m an Ubuntu user for some years now and I always enjoyed the “easy-mode” Debian flavor it’s got. But after delaying my workstation upgrade as much as I could, I knew the day would come that I’d be forced to move to Gnome 3 or Unity. The day came, and it really sucked!
I’m not going to argue why these new ways of seeing the desktop grew so much disdain in me, but I can assure you I felt quite attracted by the dark side (aka MacOS X) for my daily use and development. But then I heard about Xubuntu..

Xubuntu is Ubuntu-based and features XFCE, a old friend of mine “who” I used to have fun with back in the days when my hardware sucked – which now is totally not the case, since I’m relying on a I7 3.4GHz + 16GB DDR3 + OCZ Vertex 3 SSD disk.

And so it was, I downloaded the 64-bit alternate ISO, burned it and after 20 minutes my system was up and running. Boy, did I miss this.. you came a long way XFCE, and you still rock!
Besides lacking some of the integration I was used to in my now-gone-Gnome-days, the simplicity of this window-manager is making me really happy. In case you’re feeling the same way about Gnome 3 and/or Unity, do yourself a favor and give it a try!

Here’s some hints you may find useful. I’ll be updating this list!

  • Two DVI monitors side by side with xrandr

# Dual Monitors configuration on Xubuntu

# Monitor Order
xrandr –output DVI-I-1 –left-of DVI-I-2

#Tip: to configure it, exec ‘xrandr’ on bash to view the options by monitor

# Resolutions
xrandr –output DVI-I-1 –mode 1680×1050 –rate 60.0
xrandr –output DVI-I-2 –mode 1680×1050 –rate 60.0

# Primary Monitor
xrandr –output DVI-I-1 –primary

  • Don’t quit Pidgin when you press the close button

Don’t disable libnotify integration plug-in (if it’s not enabled by default, then enable it). You can however turn-off all options of this plug-in.

  • Dropbox support for Thunar file-manager

execute sudo apt-get install libthunarx-2-dev
and then follow the instructions available here.