Quick Tip: Checking for emptiness
Always using if(myString != null && myString.length() > 0)
? Use !TextUtils.isEmpty(myString)
instead.
Styling tab selectors for ActionBarSherlock
This post builds on the previous post for ABS + VPI.
Quick Tip: Pulling an SQLite db file from device
I have always thought that you would need root access to pull an SQLite file from a non-rooted Android device. Turns out I thought wrong! Here’s how you do it:
$ adb -d shell
$ run-as your.package.name
$ cat /data/data/your.package.name/databases/yourdatabasename >/sdcard/yourdatabasename
I Can Haz Internetz!
Last week, I was exploring connectivity monitoring and came up with a small app for demo. The app listens for connectivity changes and sends a notification to the user informing them of the change.
Making ActionBarSherlock and ViewPagerIndicator play nice
EDIT (20121227): I made a new post on changing the tab selector underline.
EDIT (20121014): I received feedback from the comments that rotating the device will cause the tab contents to revert to the default text. In essence, the adapter “loses” the contents of the tabs. I have corrected this in the example below as well as in github.
EDIT (20120905): The full sample source code is now in github.
Save Logcat contents to file
Note to self: to save the contents of Logcat to a text file:
Cloning a remote branch in git
My current project at work uses git, and I have always been a CVS/SVN baby so I’m still trying to find my way around it. Today I wanted to clone a remote branch to my local computer. This remote branch also has submodules, so I want to get those too.
Adding Preferences On-The-Fly
(Make appropriate whooshing sounds)
Inspecting your Shared Preferences
Did you know that you can look at your SharedPreferences file?
Eclipse-ception
Guys!! Eclipse just went all Inception on me!