Pages

Showing posts with label gmail. Show all posts
Showing posts with label gmail. Show all posts

Saturday, October 2, 2010

How to Create a Custom Shortcut in Android

I'd been wanting a quick and easy way to compose a new email.  I tried my hand at whipping up a simple program that just installed a homescreen shortcut, but ran into namespace issues and didn't feel like putting more than an hour into it.  A few days later while messing around with my homescreen shortcuts/widgets and discovered how to use the Custom Shortcuts option available in some aftermarket launcher programs such as ADW Launcher and LauncherPro.  I've been running CyanogenMod 6 (based on Android 2.2/Froyo) for about a month now, which includes ADW, so my screenshots and examples will reflect that.

Any Android hacks you'd like to share in the comments?


How to Create a "New Email" Shortcut (Google Doc)

On the homescreen and either long-press on empty space or hit Menu, Add:

Select "Custom shortcut" from the list:

Select "Pick your activity":

Select "Activities" (this displays a list of all activities for every installed program):

Tap "Gmail" in the list:

Sift through the various activities available within the messaging app to find "Compose(.ComposeActivityGmail)":

Once you have selected the activity, it will return you to the Custom shortcut dialog.  
Enter a name, if you don't like the default, that will display on the homescreen (you can also change the icon by touching the default icon.)  Hit "Ok" when you are done:

Huzzah! You've added a Custom Shortcut


These instructions relate to semi-stock Android 2.2 your mileage may vary.  You can also do the same for pretty much any other application that has a "Compose..." or "Edit..." activity.  I was able to create a New Gmail, New Event, and New Tweet shortcut, just had to hunt the right activity down in the list (though this didn't work for the default messaging application).  Enjoy!

Monday, February 22, 2010

My First Chrome Extension - My Shortcuts


I threw together a Chrome extension a while back when extensions were only in the development build of Chrome.  Since then I've changed my extension quite a bit, and it now has around 4,000 weekly users.  

When I first put the extension together, it was a toolstrip on the bottom of the Chrome window.  These have since been removed in favor of BrowserActions, which are single buttons on the Chrome UI.


v. 1.0 - 1.2

I thought the toolstrip worked pretty well, but you can see how my extension would get out of hand with more than a few links.  I made the switch to using the BrowserActions, this was relatively simple, I just changed the layout to vertical.

v. 1.3

I've been making incremental changes over the last few week or so, to both speed it up and add features.  The most recent release v.2.0.3 includes a new feature that allows users to create their own links to go along with the included Google links.

v 2.1


The entire project was written with InType, which is an awesome Notepad replacement with tabs and syntax highlighting.  It works very well for javascript/css/html editing, though debugging must be done within Chrome.  Highly recommend this as a replacement for a quick text editor.


In making these changes I've tried to optimize the extension to make it as small and fast as possible.  I used Google Closure tools to minify the javascript with their Closure Compiler.  In order to do this I pulled all of my js code out of the popup and options pages and put them in their own script files.  The minification of my js files saved me a few kilobytes of space.


I was able to compress the stylesheet using CSSDrive's CSS Compressor, which only saved a few bytes, but helps nonetheless.


I ran all of my images through PunyPNG, which shrunk the overall image footprint, even though only half of my images saw any change.


I'll continue making changes and listening to the feedback from users and hopefully keep it current and usable.  Thanks for the support.


Get it here: http://bit.ly/MyShortcutsChrome