Wednesday, March 17, 2010

New app "Find Comments"

Over the weekend I found a simple API from ContextVoice. It was something I was looking for a long time. A service that when given a URL of a news story, returns reader comments from all over the web.

It didn't take long to put together a simple app around this API.

FindComments is really simple.

1) Install app
1.1) Do NOT look for a new icon in the launcher. You won't find it.
2) Browse any news story or blog post in the browser.
3) Press Menu > Share Page
4) Press "Find Comments"

Voila!

Available in Android Market, AndAppStore, Slideme.

Here are screenshots. Give it a spin.



ReaderScope users, give it a try. Would you like to see this integrated tightly with ReaderScope?

Monday, March 15, 2010

@font-face-lift

I always found that customizing the look of one's website is greatly constrained by the inability to customize the typeface. Traditionally browsers use pre-installed fonts and with the CSS font-family property, you can provide a list of typefaces that you would like your text to be rendered with (Trebuchet MS, Verdana, Sans-Serif, monospace, for instance). But this list is merely a suggestion. You don't have complete control over how your web page is going to look like in X browser on Y platform.

On last friday however I found that it is about to change now (at least in my hopes). I stumbled upon a blog post which had its text rendered in a very beautiful font. After some digging through its source, I discovered the @font-face CSS property.

It's not that this is some brand new thing in latest CSS spec, but it seems to have become of practical use only in latest browsers. You can learn more about how to use it in this post. I am going to talk about my experience with it and how it is still not perfect.

If you are reading this post in an RSS reader, go on and open it up on my blog at this point. You will see it rendered in a beautiful font. But not all of you may be. What it should ideally look like is:


But is that what you see?

The snapshot above is of Safari 4.0.4 on Mac OS X. I believe it looks the same on latest Chrome versions of Linux and Mac OS X. It looks similar in Chrome on Windows XP, but on my eeepc it looks very light for some reason. It won't look anything like it at all in Firefox on any OS. That really disappointed me, but the fault here is not of Firefox, but of my blogging site blogger.com.

After a lot of debugging of why Firefox wasn't loading @font-face, I found that Firefox does not allow a webpage to load fonts that are served on a different domain. Blogger does not allow the user to host any arbitrary file, so I host my font files on www.altcanvas.com. That offends Firefox and instead of loading the custom fonts (Junction, Santana), it falls back to Trebuchet MS. You can find more details about Firefox's policy on this matter in this article.

I spent whole friday doing fun-font research for my blog. But it stoked me enough that I started redesigning www.altcanvas.com too, which desperately needed a facelift anyway.

So over the weekend with the help of two new fonts (Junction and Comfortaa) and my recently learnt CSS tricks, I redesigned my website. Check out the new look of http://www.altcanvas.com

Again the ideal look is like this:


Don't know what you will get to see. But this time, Firefox's rendering will look  just like what you see above. That's because the fonts are now hosted under the same domain that is serving the web-pages.

What I also found was, even if all modern browsers successfully show custom fonts defined with @font-face, their rendering differs. For instance, the Junction font is only available in Regular font-weight and no bold variant is available. So the bold text doesn't look any different from normal text when viewed in webkit browsers (Chrome, Safari), but Firefox (and I believe IE too) smartly creates a bold variant of the typeface. Also I guess, the final look is affected by the OS platform, screen resolution, Anti-Aliasing settings, etc. (The 'e's look poor for Junction font in IE.)

So in conclusion, we have a new powerful tool. It's not perfect, but it's pretty good.

If you want to customize typeface of your own website or blog, I highly recommend fontsquirrel's free @font-face kits.

Ads:
* CSS: The Missing Manual
* Head First HTML with CSS & XHTML
* Fonts & Encodings

Friday, March 12, 2010

ReaderScope 1.8.{2,3} - new authentication and global share

I released 1.8.2 couple of days ago. The only change it had was the new login mechanism. Google reader team announced on fougrapi group (that stands for "Friends of the Unofficial Google Reader API") that Google Reader soon will be discontinuing the old SID-based login mechanism. Thanks to them for announcing this well before the actual change is supposed to happen (sometime in April). ReaderScope accordingly has been updated to follow the new rules.

This change is almost painless for username/password based logins. However the  AutoLogin is a little hairy issue. The library used to get AutoLogin working is unsupported and undocumented. There is an official way to do AutoLogin kind of thing on Android 2.0 devices, but it requires access to actual device to test and still I hear it's not well documented. Besides the devices at versions <2.0 are going to be there for  a long time. Therefore I got the undocumented and unsupported library to get working somehow with the new auth mechanism. However the changes I had to make were only little short of hocus-pocus. So I was very skeptical about how it was working. I released a preview on ReaderScope mailing list. So far the feedback of the preview release and actual 1.8.2 has been positive. I haven't seen anyone reporting issues due to failed logins. I have strategic log statements to detect if things go wrong with authentication. So just mail me the logs if you see suspicious behavior. Settings > Logs. Menu > Email.

Today in 1.8.3, I also fixed a bug which would have caused auth problems if anyone was upgrading from pre-1.2.5 installation.

With the new authentication done, I have a very exciting feature implemented in 1.8.3.

When you share the news item now, you will have option to trigger the global sharing apps. They could be your favorite Twitter, Facebook, Email clients. The most useful one I found was "Read It Later" which lets you save the news item to your InstaPaper account for reading later. These are the same apps that you see when you "Share Page" from browser.


I remember someone had requested this feature once long time ago. I am sorry it took so long to implement. But now that it is here, I am sure you will enjoy it.

Ads:
Hello, Android: Introducing Google's Mobile Development Platform (Pragmatic Programmers)
Professional Android Application Development (Wrox Programmer to Programmer)
Android Wireless Application Development

Tuesday, March 09, 2010

Portable apps for iPhone, Android, Pre, n900 - Can Processing.js help?

I don't know. But if you want to find out, then I have something for you.

Processing.alt

Visit this website from your desktop browser. You will see an IDE. Write some processing code to create a sketch and save it when you are done.

Visit the same website from your iPhone/Android/n900/Pre browser. You will get a simple viewer interface. Find your sketch under My Sketchbook and run it.

Processing is a well known language to create sketches, animations, games. It is a simplified dialect of java. The resulting sketches are in the form of bytecode and can be run on desktop or in java applets. In Summer of 2008, John Resig (jQuery fame) ported Processing to javascript. Processing.js uses the HTML5 canvas element to render the sketches.

The modern browsers that ship with today's smart phones support HTML5 element. So it is very much plausible to get your Processing sketch/game working on all the modern smart phones without any knowledge of native app development for each platform. Processing.js has a potential to become an uber-portable library for mobile development.

That was the idea I started out with about a month ago. After several iterations, I ended up with a website that you see now. It is an IDE when opened from desktop browser. You can write Processing code, run it, save it, share it for others to see in the Gallery. There are also some samples you can find in Gallery right now. Try them out.

The same website acts as a viewer for your processing sketch when opened from a mobile phone. You can view the shared sketches from the Gallery or you can login and find your saved sketches in My Sketchbook.

One great advantage of Processing.js is, it can intermix javascript with Processing code. So in the samples you will find how javascript is used to automatically find  the kind of browser and adjust the dimensions of the sketch accordingly.

I have tested the site on Android HTC Magic and Nokia n900. A friend told me it worked as expected on his iPhone too. Also I am treating Palm Pre's user agent as mobile platform. So on these four platforms you should see the mobile interface of the website. But in case if you don't, let me know and I'll see what is wrong.

As you will see that running Processing code on smartphones is indeed possible, but is fairly sluggish. However I believe the future is not far when the phones will become more powerful, browsers will become more optimized and Processing.js can also be tuned for speed. We already have two gadgets with 1GHz processors - Nexus One and iPad.

The IDE also has a lot of scope for innovation. But before jumping ahead of myself, I decided to open it as beta. I would like to hear your thoughts and suggestions on this idea.

So try it out and leave your opinion in the comments.

P.S. For logging in to save your sketches, use your GMail account. You don't need to login to browse through the Gallery.


Ads:
Processing: A Programming Handbook for Visual Designers and Artists
Learning Processing: A Beginner's Guide to Programming Images, Animation, and Interaction (Morgan Kaufmann Series in Computer Graphics)
Processing: Creative Coding and Computational Art (Foundation)

Saturday, March 06, 2010

ReaderScope 1.8.1 - rethinking features

In the release-early-release-often model, as the software product evolves over time, new features get added consistently. The same happened with ReaderScope for over 7 months. It started with very basic functionality and went through many iterations to reach at its current state.

Adding lot of new features however has couple of risks. First one is affecting the performance. I try to keep that under control after completing a round of new features. Memory footprint analysis and some latency measurement checks have helped to keep the ReaderScope UI very responsive over time. The second downside of features is loosing the direction, unknowingly causing a feature creep. So once in a while, it is essential that the software developer steps back a little and reviews the direction his/her software is going in. That's what I am doing in this post.

There is one feature in ReaderScope that I added few months back that I am not sure helps the main direction of the app. It is the tabbed interface. When I added it, my intent was to cater news from channels besides Google Reader. I put the Google News feeds under the News tab and was planning to add more feeds from popular news channels too. The third tab was Social. It had only a single feed for Twitter account. It smartly parsed the Twitter messages and extracted the news items pointed by the embedded links. (I love the Twitter feature and it's not going away, read below... actually nothing is going away for that matter).

Over time I have realized that the tabs are not serving any useful purpose for most of the userbase. I would rather spend time improving the Google Reader specific functionality than supporting the half baked extra tabs.

Therefore starting from v1.8.1 the tabs are disabled by default. You will only see the labels and feeds from your Google Reader account just like old days. The "Social Channels" label (which was part of the Social tab) will now appear at the bottom of your Google Reader List. If you want you can configure it to appear at the top or be invisible altogether (Settings > Customize Layout).


And for some reason if you like the tabs, you still have option. Go to Settings > Miscellaneous > Enable Tab Interface. You will get the old interface back.

One more feature is the favicons. Favicons are pretty if you read the feeds that do have favicons. However, not all users may have subscribed to feeds that publish favicons. Out of my 250+ feeds at least 150+ show valid favicons. But for some users most of their feeds may not be publishing any favicons. For them the favicon placeholder appears empty. If they are using dark themes then these placeholders appear as white rounded squares. Understandably, those users would like to turn off the favicon feature. Now they can. Head over to Settings > Value Pack > Load FavIcons and uncheck the box if you  want. (The favicon feature concerns only the Value Pack users. You haven't got one yet? It's only $2.49, hurry!)

I hope these changes simplify the UI for you. Let me know how you like it.

v1.8.1 also has one crash fix. There was a bug which could lead to crash if you immediately quit the app after starting it. It was specific to Value pack owners. It is fixed in this version.