Sunday, October 16, 2011

Sync Google calendar with Gnome Clock (calendar applet)

This guide explains how to do it:

http://utkarshsengar.com/2009/11/google-calendar-with-gnome-clock/

Sunday, September 25, 2011

Remove app from device (fast)

This guide is a fast way to remove an apk you have been developing from the device:


  1. For easy access to the adb binary, create a folder in your home directory bin and place a symbolic link to your original adb binary.
    cd ~
      • mkdir bin
      • cd bin
ln -s ../Software/android-sdk-linux_86/platform-tools/adb adb
(if your original adb binary lives in /home/your_user_name/Software/android-sdk-linux_86)
  1. Re-login to your Ubuntu workstation and you are done.
Next time to quickly remove your app, open a terminal prompt (Ctrl+Alt+T) and type adb uninstall your.app.package.name.

Sunday, August 28, 2011

Android Logging Best Practices

You are implementing some small piece of logic, deep inside of your code's activities and a crash occurs, problem is, you have been scrolling LogCat window and you can't find your exception. Here are some best ways to stop wasting time, filtering out the useless:
  • Create a TAG with which you will be logging all the time. Saves memory and time. i.e. 
public static final String TAG = "MyApplicationTag";
or
public static final String TAG = MyActivityClass.class.getSimpleName();

...

Then in your code:
...

Log.d(TAG, "log this");


One for an entire application, one per activity. As long as it makes sense to you and you can quickly find it.

Additional tips:
  • Setup additional tabs inside of LogCat. These are very useful:
    • AndroidRuntime
    • System.err
    • MediaProvider
  • Create a utility class
public static class SuperAppLog {

public final static String TAG = SuperAppLog.class.getSimpleName();

public void error(String message) {
// .. do some app wide logging
// .. redirect to a file
// .. fire off a analytics logging request
// .. etc
}

}



That's it. If you want to get more fancy or mess around with Log levels, check out this answer or this guide.

Happy Coding!

Tuesday, June 28, 2011

GStreamer resource error: NotFound

For some reason Banshee stopped playing sound and displayed the error.

rm -rf ~/.config/banshee-1/



Wednesday, June 22, 2011

DVD Support for linux

Got this error on my linux machine:

libdvdread: Encrypted DVD support unavailable.

Came across this link:

http://kyleabaker.com/bbpress/topic.php?id=56

That's all you need to know. In case the link dies:

Enable Commercial DVD Playback
sudo wget http://www.medibuntu.org/sources.list.d/lucid.list -O /etc/apt/sources.list.d/medibuntu.list
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
sudo apt-get install libdvdcss2