Sunday, July 25, 2010

App Review - Quick Settings

Today I want to talk about a Settings-type app that really impressed me. This is Quick Settings from Sergej Shafarenka. It presents a simple UI to quickly change the brightness, volume, and various battery draining services such as bluetooth and wi-fi. For most people, a settings app is not a high priority because your phone comes with useful widgets for toggling bluetooth, wifi, etc., However, Quick Settings is so well designed and polished, I would recommend downloading it*.

Walkthrough

Quick Settings

The default list of settings are the ones I tend to use most, and they are: brightness; volume; WI-FI, GPS, and the bluetooth toggle. The top right hand corner features a flashlight and a shortcut to the battery use indicator.

The Battery Indicator
The top left is a screen brightness slider: Slide all the way to the left for minimal brightness, and all the way to the right for full brightness, and the icons on the left and right are convenient shortcuts for min and max. The toggle to the right of it, enable or disable the auto-brightness feature.

Auto Brightness Enabled (the right-most toggle = "ON")
Touch the "Volume control" and you will be shown the list of available volume options for your phone. Finding this was my "this is awesome" moment.



Most optons (toggles) are fairly obvious. But you might ask, "What is APN control?" Here's a nice bonus - Sergei has a wiki page on it.



Who and why might need APN control?
  • Who: anyone with a GSM (not CDMA) phone which does not have a native switch for data connection activation and inactivation. Normally these are phones running prior Android 2.2 version with no Sense UI (like my old HTC Magic).
  • Why: because you don't want to pay for data traffic all the time and you want to have a possibility to switch data connection off even if there is no such possibility in the phone itself.
When do I not need to use this control?
  • If your phone has native data switch available via system properties or as a widget
  • If you have a CDMA phone
  • If you have problems with this control

My wife and I are on a CDMA network, so this control is not necessary for me. So I decided to remove it. Quick Settings allows you to customize what settings are visible. Just open up the app's menu and you will see 2 menu items: Customize and Preferences. Touch "Customize".

The "Customize" page

The customize page needs a little bit of explanation. On the right-most side of each option is a "slider" icon. Touch the slider icon and slide up and down to adjust the ordering of the setting on the settings page. If you slide it down past the "Hidden Settings" separator, then the setting will no longer be visible on the settings page.

There are a number of hidden toggles you can add to the settings page. For me, my settings page contains the following: Brightness, volume, ringer (quick toggle to put phone into silence mode for meetings), bluetooth, WI-FI, GPS, auto-sync (disable during meetings or when I go to bed).

The menu item in Quick Setting's option menu is the Preferences page, which will look familiar to every Android user.



Here you can change the Full screen/Dialog look and feel (Appearance). The dialog mode has a nice look to it, but I stuck with the more functioanl Full screen mode. The status bar option lets you access Quick Settings via Android's notification bar at the top:

Adds a Quick Settings icon to the top notification area.
However, I find it to be more cumbersome to access Quick Settings via notification. It is worth putting a shortcut to Quick Settings on your primary home screen instead.

You can choose to enable the LED flashlight. You will be shown a warning in this case. I appreciated seeing this warning - I did not know the LEDs on these phone can be fragile.



Comparison

I'll compare Quick Settings to one other settings-type app I've used before - MySettings from JQSoft. I first read about this app via an App Surgery post from an Android Developer Advocate at Google. When I looked at MySettings I've found it didn't add bring a lot to the table other than a quick way to access screen brightness. Yes, it had access to a bunch of other things like WI-FI, bluetooth, etc., but I thought the toggle widgets that came with the phone were more convenient to use. The UI on Quick Settings looks better and cleaner to me, the ability to customize is a big win, and the centralized volume control is what made me want to keep Quick Settings in the first place. At the end of the day, Quick Settings feels like an app where the developer(s) put a lot of time and effort into giving it Quality - that means a lot to me.

It would also make sense to compare Quick Settings to the default toggles on the phone. Here I will the list of the toggle widgets that came with the Droid X.

On top, the Droid X toggles

First, I just want to say that the 5 toggle widgets in the screenshot just disappeared for a second and re-added themselves as I was typing this. I've seen this happen a couple of times before and I think this is a problem with Motorola's code - I've never seen this on the HTC Droid Incredible. Second, while the same set of toggles on the Incredible are responsive and easy to use - the Motorla version feels clumsy. The look and feel of Motorola's hints that you would swipe up/down at the widgets to toggle on and off - in reality you are only suppose to tap them - ugh, this is bad UI.

What's nice about toggle widgets is that you can turn things on and off without opening up an settings app first, but a combination of clumsy widgets from Motorla and all the features in the Quick Settings app really makes me prefer the app over the widgets; your mileage may vary.

Summary

Before you install Quick Settings, think about whether the native widgets would do well enough for you. For most people it might not be a necessity. However, Quick Settings has a wide range of customizable features and is quite polished. It is definitely worth checking out.


* - Bias warning - I am a big fan of the Open Source philosophy, so Quick Settings probably gets bonus points for being Open Source.

Sunday, July 18, 2010

App Review - Google's Gesture Search

Google's Gesture Search is one of my favorite apps on Android phone. Touch the Gesture icon and you will be presented with a blank screen to write on. As you write letters and words onto the screen, Gesture looks up shortcuts to applications, contacts, music, and browser bookmarks on your phone.

Gesture Search is similar to Spotlight (for Mac) and Launchy (Windows and Linux); it is an app that tries to help you find what you want using completion and prediction. Given the number of apps, contacts, and music on your phone, it can quickly become too tedious to navigate. Gesture Search lets you find what your're looking for with one touch and a few "gestures" on your screen.


Download and Install



Android link (phone required): Marketplace
Tutorial


Touch to start. You will want a shortcut on your Home screen. Read the terms and conditions and hit Accept if you agree.






You start at a blank screen. Start writing on the screen with your finger to search. Here, I clumsily wrote a letter "G":



Recognizing the letter "G", Android shows a list of "things" you are interested in. This could be an app (Gmail) or a bookmark (http://espn.go.com):



To refine your search, just keep writing. Let's say I am interested in the "Google Reader", which is not entirely in view for me to select. So I write the letter "O" onto the screen.


Recognizing the sequence "G-O", here's the new list of options:


Google reader, one of my bookmarks, is now #4 in the list, making it easy to select and find.

If you go back to Gesture again, you will see the last selected shortcut by default. This turns out to be a convenient way to access your last application. Let's do the same search again, go ahead and draw "G" onto the screen. 


This time, with just one letter drawn, "Google Reader" becomes the #1 option on your screen. Gesture keeps track of your favorite shortcuts and tries to intelligently show you the most relevant results.

How to use

Gesture does incremental search (showing refined results as you draw) and prediction (using history and heuristics to provide its best results). I find it to be extremely useful for navigating my gigantic contact list. In most cases, I can get to the contact I am looking with just one drawing.

While Gesture can be used to launch apps, it probably is most useful for those rarely used apps and your contacts. Your most used apps should have shortcut icons on your Home screen - Gesture being one of them. Then use Gesture Search to look for the things that you don't use that often. You should get rid of the "Contact list" shortcut completely, as Gesture Search is simply much more convenient.

If you take a look at the settings menu, you will see that you can enable "Search Music".




You probably don't want to enable searching music. If you have hundreds of songs like I do, your songs will clutter up your Gesture search. This option is disabled by default for a good reason.

Areas of Improvement

Gesture Search is a Google Labs product. This explains why its not included on Android phones by default. It also means that it is actively being looked at for improvement. 

A great area for improvement would be the ability to support non-latin languages such as Chinese characters. Although this is likely to be quite difficult to implement.

If gesture can recognize multiple letters drawn together in cursive as opposed to drawing one letter at a time, it would significantly speed up searches.

A easier improvement would be a reorganization of search results. Instead of one list, it would be nice to have results grouped by type:


This should make it a bit easier to look for the desired result when the search returns too many similar results (when "searching for music" is enabled, for example). This UI also provides a point for the user to specify the "type" of result they are interested in, which is missing today. The trade off is that you'd lose screen real estate, but the trade off might be worth it. 

Another option would be to have filter buttons that allows the user to specify what kind of result to look for. This might waste less screen space, but requires an additional user interaction. 

As gesture search continue to expand the number of searchable items, a better filtering UI will be come more important.

I find myself using Gesture Search to quickly get back to the "last app" I launched. Perhaps by default it should show a list of recently accessed apps, contacts, or documents. This

Lastly, this kind of search facility should be exposed as a Service API to applications, and become an integrated part of the Android OS. This will allow gesture style search to be available in all sorts of applications.

Wrap Up

Gesture Search might be a Google Labs application, but it is still a must have on any Android phone. I seriously can't imagine navigating the 70+ apps and ungodly number of contacts I have without it. I noticed that I have removed lots of shortcuts and started using Gesture Search to launch apps now, which leaves me with more screen space to plop down widgets. It really is a wonderful app. I can't wait to see the graduated product.


Monday, July 12, 2010

pymv.py - A batch file rename script

Here's a script I wrote to batch rename files, tested on Python 2.5.2, support for "yield" keyword is required.

#!/usr/bin/env python

import os
import re
import shutil

################################################################################
#                                                                              #
# Script to batch rename files using a regular expression.                     #
#                                                                              #
################################################################################

def get_opt():
    from optparse import OptionParser
    parser = OptionParser('usage: %prog -s  (-c|-m) -i in_pattern -o out_pattern [-e regexp]')
    parser.add_option('-v', '--verbose', help='Verbose output.', action='store_true')
    parser.add_option('-t', '--test', help='Test mode.', action='store_true')
    parser.add_option('-c', '--copy', action='store_true',
                      help='Use copy mode, which copies the FROM file into the ' \
                      'TO name. Not compatible with the -m option.')
    parser.add_option('-m', '--move', action='store_true',
                      help='Use move mode, which renameds the FROM to the ' \
                      'TO file. Not compatible with the -c option.')
    parser.add_option('-i', '--inname', 
                      help='A regular expression to match against file names.')
    parser.add_option('-o', '--outname', 
                      help='A replacement pattern for output file name. ' \
                          'The "To" pattern may refer capture groups in the "From" '\
                          'parameter.')
    parser.add_option('-s', '--startdir', 
                      help='Recusively search the specified directory for files to process.')
    parser.add_option('-e', '--extra', 
                      help='An filter pattern to be applied on the full input file name, '\
                          'only files that matches this pattern will be processed.')
    parser.defaults = {
        'verbose' : False,
        'test' : False,
        'copy' : False,
        'move' : False,
        'inname' : None,
        'outname' : None,
        'startdir' : None,
        'extra' : None
        }
    params, args = parser.parse_args()
    def _err(message):
        print message
        params.ok = False
        return params
    params.ok = True
    if not (params.copy or params.move):
        return _err('No mode specified: Please specify either -c (copy) or -m (move).')

    if (params.copy and params.move):
        return _err('Too many modes specified: Does not support -c (copy) AND ' \
                        '-m (move) together.')

    if not (params.inname and params.outname):
        return _err('File name required: Must specify a pattern for input and ' \
                        'output files.')
    
    if not params.startdir:
        return _err('Must specify a starting directory.')

    params.inpattern = re.compile(params.inname)
    if params.extra:
        params.extrapattern = re.compile(params.extra)
    else:
        params.extrapattern = None

    return params

class MatchedFile:
    def __init__(self):
        self.basename = None
        self.filename = None
        self.toname = None

    def __repr__(self):
        return 'b=%s, i=%s, o=%s' % (self.dirname, self.basename, self.toname)

def match_file_or_dir(params, root):
    for elem in os.listdir(root):
        elem = os.path.join(root, elem)
        if os.path.isdir(elem):
            for subelem in match_file_or_dir(params, elem):
                yield subelem
        else:
            dirname = os.path.dirname(elem)
            basename = os.path.basename(elem)
            m = params.inpattern.match(basename)
            file = MatchedFile()
            file.basename = basename
            file.dirname = dirname
            if m:
                file.toname = m.expand(params.outname)
                if not params.extrapattern:
                    yield file
                elif params.extrapattern.match(os.path.join(dirname, basename)):
                    yield file


if __name__ == '__main__':
    params = get_opt()
    if params.ok:
        for elem in match_file_or_dir(params, params.startdir):
            absname = os.path.join(elem.dirname, elem.basename)
            absto = os.path.join(elem.dirname, elem.toname)
            if elem.basename == elem.toname:
                print 'file %s not changed' % (absname)
            elif params.copy:
                if params.verbose:
                    print 'cp %s %s' % (absname, absto)
                if not params.test:
                    shutil.copyfile(absname, absto)
            elif params.move:
                if params.verbose:
                    print 'mv %s %s' % (absname, absto)
                if not params.test:
                    shutil.move(absname, absto)

Friday, July 09, 2010

Droid Tip - Shortcut to take you home

If you have a Droid incredible, you can create a one-push button to get directions back to your home, no matter where you are. It is amazingly useful, and so simple to create and use, it really is a must-have on your phone!


To set up your shortcut, press and hold on the home screen



Create a "Shortcut"



Select "Directions & Navigation"


Then put in your home address, a shortcut name, and hit "Save"


Presto! Just push Go Home for satellite navigation home!

Thursday, July 01, 2010

App counting is the new MHZ war

Just saw a link on Reddit about how Android has 80,000+ apps. Apple claims to have 100,000+ of apps. Just to put it in perspective, Windows shows 202,665 apps on CNET alone. However, it really doesn't mean anything, does it?

It brings me back to the early 2000 when AMD and Intel each tried to up-megahertz each other for marketing's sake, sometimes at the expense of actual CPU performance. Sometimes, having a bigger number isn't actually better.

I'm glad that Android can show that it has a vibrant marketplace, but I think its about time to stop talking about the number of apps, but start demoing the number of quality apps.

I'm thankful  that Apple dragged us into the mobile generation. And here's a special  thanks for creating another meaningless metric - "My apps are bigger than your apps".

Thursday, June 24, 2010

The future of computing is in the clouds

Smartphones and the tablets are taking the computer business by storm. People are starting to do more with their smartphones, and the latest phones continue to improve. As smartphones and tablets get cheaper and more useful, we're going to see a future where people have access to advanced computers everywhere they go, where people are going to be connected to the Internet everywhere they go.

As technology evolve, one thing is apparent to me - Cloud Computing is the future. Cloud computing is simply the idea that everything your need will be accessible on demand on the Internet. Keeping a book of recipes? Instead of having files on your desktop, you can now edit and save it on Office Live or Google Docs. Family photos? Keep them on on Flickr or Picasa. Play games? You have a wide range of options between the likes of MSN Zone, XBOX live, to hardcore games like WoW Online. Keeping a journal? People blog, twitter, and post to Facebook instead. We are already stepping into a world where people keep all of their data and applications online. I think most people find it to be convenient, and I think it will be the future of computers.

The greatest advantage of cloud computing is that it is accessible everywhere. You can start a shopping list at home, update it on the go using your phone, and you can update it anywhere you have access to a computer. Do you need to look up an old friend's phone number? If it is not on your phone already, you can simply walk up to any electronic device - computer, TV, radio, or your car - and ask for that information via voice commands. Sometimes down the road, we will be living in a world where anything you own can be readily available at your fingertips no matter where you are.

Having your files everywhere also means you no longer have to deal with the pains of backups, restores, and upgrades. With everything you need online, you can pick up any computer, log on to your account, and you will have everything right there, organized the way you have it. Buying a new phone no longer means backing up and copying your contacts - you can simply turn on your new phone and have all of your apps, music, bookmarks, feeds, and contacts transferred. You never have to worry about data loss because your data is automatically archived and backed up. Take Google Docs for example, it automatically keeps historical records of your word document, spreadsheet, and slideshows for you so you don't have to be worried about data loss.

An always-on, data-everywhere world is not limited to phones and computers; TV and radio will be integrated into this always connected world as well. The videos you record on your camcorder will be available to watch on your TV as soon as you get home. Your favorite music and videos can be streamed to your radio at home, in your car, or on your phone. You might see an interesting TV show while you are travelling, and with a push of a button, subscribe to that show on your personal TV at home. The line between traditional "broadcast" TV and YouTube's personalized playlist will blur. As we head into the computing cloud, the separation between TV, computer, and phones will become indistinct - they just become entertainment devices of different shape and size.

While cloud computing is not without its flaws, I think it will be the most convenient option for most people. As a software developer, it is obvious that the ability to integrate into "the cloud" and making your app accessible everywhere will be a key feature. The challenge today is a lack of a standard API, or process, for doing that in your software. One possible solution is Google's Document List API - Google now allows you to save arbitrary files into the profile of anyone with a gmail account. It is still a hacky way of doing things, but it does do the job. To me it is obvious Google recognize the future importance of online file storage, and I fully expect Google to further integrate this key feature into their software releases (Android and Chrome OS). If there is one huge advantage that Google has over Apple when it comes to the future of computers, it will be Google's huge network infrastructure. I would not be surprised to see a "G-drive" API in Android SDK in the near future. The ability to make your apps and data everywhere will make the next killer app, and Google will most likely be the one to come out with it.

Wednesday, June 23, 2010

Android Developers Blog: The Froyo Code Drop

I am a big believer in Android, and I am so proud to see the passion and love behind the software.

Android Developers Blog: The Froyo Code Drop