Saturday, November 28, 2009

A Little SQLite Goodness for Android

I recently pattern locked my Sprint PCS HTC Hero and, somehow locked myself out of my phone completely. And, like many others, I found out that once you do this, there's no easy way to get back into your phone: http://forum.xda-developers.com/showthread.php?t=485903. Instead of calling technical support, I decided to solve the problem on my own and here's what I did:

I was lucky in that I had already enabled USB debugging on my phone. Otherwise, I would have been totally dead in the water. So, I highly recommend that you download the android development kit and turn USB debugging on before breaking your phone: http://developer.android.com/sdk/. If you have the android SDK and you change your phone settings to: Settings -> Applications -> Development -> USB Debugging = enabled, then you can hack at your phone from your computer.
  1. Plug phone into computer via USB
  2. Download http://zenthought.org/tmp/asroot2
  3. adb push asroot2 /data/local/ && ./adb shell chmod 0755 /data/local/asroot2
  4. adb shell
  5. /data/local/asroot2 /system/bin/sh
  6. chmod 777 /data/data/com.android.providers.settings/databases/settings.db
Now, you have root access to your android phone and you have changed the permissions to the "settings.db" so that you can pull/push it from your computer back to the phone. Many thanks to "briankwest" and this post for that valuable tidbit. Next, comes the hard part that I had to figure out on my own:
  1. Pull the sqlite database file from your phone settings using this command: adb pull /data/data/com.android.providers.settings/databases/settings.db ./settings.db
  2. Make a copy of this file to make sure you can push the original settings back, if needed: cp settings.db settings.db.bak
  3. Download SQLite database browser from here: http://sourceforge.net/projects/sqlitebrowser/
  4. Open the "settings.db" file that you pulled in #1 in SQLite Database Browser
  5. Browse data in the "system" table. You are looking for 2 rows: "lock_pattern_autolock" and "lockscreen.lockedoutpermanently"
  6. Make sure both rows have a value of "0" instead of "1". You can use SQLite to modify this data once you've browsed to it
  7. Save the database file and close the SQLite browser
  8. Push the sqlite database file back to your phone using this command: adb push settings.db /data/data/com.android.providers.settings/databases/settings.db
  9. Turn your phone off/on and your phone will no longer be locked! And, you don't have to worry about fixing the permissions on settings.db. When your phone started, it reset the permissions on that file back to the default, which means you will have to root back in and re-chmod if you didn't update the settings.db file properly.
This information kept me from calling Sprint PCS customer service, something I only do if absolutely necessary. Also, this is a nifty way to change pretty much any SQLite data on your phone.

Sunday, September 20, 2009

Excellent Blueprint for Startup Success

If you work for a startup or if you take the plunge and create a startup, it is wise to learn more about proven principles for success. Often times, startup experience alone is not enough, because most startups fail and many of those failures are the result of repeating the same mistakes over and over. For those of us that started our career in large, well funded companies, the bare bones nature of a startup is unnerving. We will attempt to put proven "big company" processes/methodologies in place to ensure success, and we will be a key contributor to failure. Entrepreneurial superstars will revolt against any process/methodology and insist on constant change and micromanagement. And, those superstars will also be key contributors to failure. So, how much process should be present in sales, marketing, and product development? The answer is, it depends. Thankfully, this book explains, "it depends" and provides an invaluable blueprint for maximizing the chances of success.

There are two things you should know about this book before purchasing. First, the author, Steven Gary Blank, is a real-deal Silicon Valley VC veteran that teaches for both Stanford and Berkeley. This book is a great way to obtain MBA grade knowledge without quitting your day job. Secondly, the book is not cheap($40) but it is poorly edited. There are quite a few typos and the graphics are borderline bad, but if you look past the lack of editing polish, you'll realize that this information is easily worth ten times its cost. The book was released in 2005 and four years later most startups still ignore these proven principles. But, a new term for this type of startup has emerged, The Lean Startup. Here are three good resources that will get you up to speed on lean startups:

Sunday, September 13, 2009

Books that Chronicle the Brave New IT World

I recently finished reading an interesting book: What Would Google Do?, by Jeff Jarvis. While reading the book, I kept thinking about how this book builds upon many of the same ideas of another great book: The World is Flat, by Thomas L. Friedman. In fact, I believe that Jarvis' book chronicles the rise of a new breed of technology companies. And, Google is the poster child of what works in this Brave New IT World. Every enterprise developer should read both books. Moreover, after reading both books, you should be very concerned if the company you work for violates or ignores the laws that define this new age.

The World is Flat
I must admit that I've had my copy of The World is Flat: a Brief History of the Twenty-First Century for a couple years and I just recently read this excellent book. I was worried that the book would be outdated but I was surprised to find that the principles outlined in the book are dead on and will be applicable for several decades. Some aspects of the book scared me quite a bit. The most bothersome chapters are:
But, what makes this book timeless is the detailed review of the ten key flatteners that have led to the current state of the Information Technology industry. None of the flatteners are earth shattering discoveries, but I was surprised by the significant societal impact of these flatteners.

What Would Google Do?
I began reading What Would Google Do? immediately because I'm enamored with Google's technology and the way they are changing the world we live in. The following chapters describe the principles Google follows to dominate the search and advertising market and spread its dominance into other markets, like mobile(Android), and a wide array of applications.
  • New Relationship
  • New Architecture
  • New Publicness
  • New Society
  • New Economy
  • New Business Reality
  • New Attitude
  • New Ethic
  • New Speed
  • New Imperatives
This book explains how companies can embrace this Brave New World and re-use the ideas that led to Google's success. I use the concepts in this book to question my company's product development/delivery strategy. And, I believe that going against these laws is a recipe for disaster. Ironically, WWGD? does not have a preview on books.google.com, but a free Google like preview can be found here. the author does blog heavily at buzzmachine.com, and a good synopsis of his book can be found here.

The World is Flat describes how we arrived in this Brave New World. And, WWGD? provides survival tips for this Brave New World. Read them both and you will have a better understanding of the rules that dictate your fate as a technology professional.

Friday, July 3, 2009

HTML5 is a Big Deal for Enterprise Developers

I was recently made aware of HTML5's canvas element and I believe that this could render Silverlight, JavaFX and Flex obsolete.

HTML5 Canvas Overview
The "canvas" tag allows you to embed script based graphics, usually JavaScript, in your page. The Filamant Group blog has an excellent writeup and they also provide a jQuery based charting script: http://www.filamentgroup.com/lab/creating_accessible_charts_using_canvas_and_jquery/.
For $80, the RGraph Beta is available: http://www.rgraph.net/. For custom visualizations, Mozilla provides an excellent canvas tutorial: https://developer.mozilla.org/en/Canvas_tutorial. For neat animations check out: http://jeko.free.fr/megapong/ and http://code.google.com/p/cakejs/

Why this is a Big Deal
HML5 is a big deal because it provides a standards based alternative to Silverlight, Flex and JavaFX. Expect the leading Ajax frameworks, like JQuery and GWT, to provide programmer friendly APIs for common visualizations. I was unable to find a good canvas visualization designer, but I do believe that we will see several in the coming years. Also, I expect canvas support on mobile devices even if Microsoft refuses to support it in IE. It looks like Firefox, Chrome, Safari and Opera already support canvas. And, I fully expect IE market share to continue to decline making it more likely for IE to suck it up and support HTML5 properly: http://www.w3schools.com/browsers/browsers_stats.asp.

Key Missing Ingredients
The missing ingredients for a HTML5 revolution are:
  • IDE Tooling - A killer HTML5 IDE that rivals Adobe FlashBuilder and Microsoft Expression is needed. Unfortunately, neither Microsoft or Adobe has an incentive to innovate here.
  • Framework Support - jQuery, GWT and other leading Ajax frameworks need to make it easy for programmers to build nice canvas based visualizations. I see significant movement here and I do believe that this will happen.
  • Blogs, Books and Success Stories - Programmers need to blog about HTML5, good books are needed on HTML5 for mobile/desktop and noteworthy success stories will round out the triple threat.
I hope HTML5 gains momentum and I will be keeping a close eye on this technology. Google has deep pockets and a lot to gain if this technology can replace plug-in based RIAs.

Saturday, June 20, 2009

Ideas for Improving Software Quality

Poor software quality is bad and should be avoided at all costs. Maintaining a high quality level is increasingly difficult as the project duration and team size increase, but it is not impossible. If you are using Scrum or another compatible agile methodology these ideas will help bring quality back.

MVP and Wall of Shame
At the end of every sprint, designate an MVP(Most Valuable Player). This MVP is the developer that has the highest feature to defect ratio. If you have a sophisticated issue tracking system, it will be easy to get this information, otherwise you will have to use a more subjective determination process.

It also helps to maintain a Wall of Shame list that goes out to the entire R&D organization on a weekly basis. Developers get on the Wall of Shame list when they:
  1. Break the build
  2. Fail to provide adequate unit tests for code
  3. Commit code that passes unit tests but fails a simple functional test
Be careful with the Wall of Shame. It should be easy for developers to get off the Wall of Shame list, and no developer should stay on the list for more than one week. If a developer stays on the Wall of Shame for more than two weeks or is a frequent Wall of Shame member, he needs to be kicked off the project. Conversely, if a developer drastically improves his performance after going on the Wall of Shame, you need to acknowledge it and let the team know that this member has more than made up for his mistakes.

Automated Functional Testing
Unit tests are important but automated functional tests are also needed, especially if the project uses RIA(Rich Internet Application) technologies like Flex/GWT. Flex is hard to unit test, but RiaTest is a good tool. Resist the temptation to delegate functional test automation. The developer should maintain functional tests as part of normal code maintenance. This tenet is very hard to stay committed to, so expect less than ideal automated functional test coverage and fight hard for more each and every day.

Integration Test Cycle
After a sprint, resist the temptation to immediately begin a new round of development. If you have a demo worthy product at the end of the sprint, spend up to a full week on integration testing. Every developer, lead and QA team member should be fully dedicated to this test effort. If a developer finds a defect in his code, that defect should NOT put him on the Wall of Shame list, no matter how inexcusable. The developer should be commended for finding and admitting the flaw. The only "Get Out of Jail Free" time is in this short integration test period. Outside of this period, all defects are candidates for the "Wall of Shame".

These strategies can improve the quality of your software, but like all good ideas they are no silver bullet. As the size of a team and project duration grow, the likelihood of apathy increases. Team members assume that someone else will fix a problem, and a problem can explode into an impressive list of problems quickly. Your goal as a Leader is to keep this from happening, and if apathy creeps in, ruthlessly destroy it.