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.

Friday, February 26, 2010

ReaderScope 1.8 - Random

Just pushed out v1.8 of ReaderScope. Added a new feature after a long optimization-bugfix cycles in v1.7.x.

When I added home screen widget in ReaderScope, I realized how convenient it was to directly jump to the news items from the home screen, instead of opening the app and sliding through two screens. Typically during a news reading session we want to go through all the new items in all our favorite feeds. We don't necessarily care in what order. So to ease this use case, ReaderScope 1.8 introduces "Random".

When you open RS you will see a new label named "Random" at the top. When you tap on the arrow next to this label, you will directly jump to a news item. You can then use down arrow button to go to the next randomly chosen news item.


Now here is a killer. When you tap on the widget on home screen, you will be taken directly to the news item which will also have up-down arrows. It will work the same way mentioned above. In other words, you may go through all your unread news items without opening the full ReaderScope app. Just place the widget on home screen. (Note that, the full widget functionality is only available if you have the value pack installed. It's just $2.49. What are you waiting for? :)

Go ahead, update to v1.8 and let me know what you think.

And yes, do you want a FREE unlock code for the value pack. The Promotional Offer #2 is on for this weekend. First 5 people who twit about ReaderScope will get FREE unlock codes in email. It's not necessary to say only nice things, just twit your opinion about @readerscope and you will qualify for the offer. You can do this from inside the app too. Just go to Settings -> Spread the Word and you will know what to do.

P.S. I also fixed a database update issue in this release, which may concern few users who are upgrading from very old RS version (like  pre1.3)

Android fragmentation : How big a deal is it?

I came across this Infoworld story via slashdot the other day, with a sensational headline: "Google Android - a Universe of Incompatible Devices". The actual headline of the article is even more catchy "Google Android's self destruction derby begins".

The job of headlines is to attract readers. But the truth is hardly black or white. Furthermore the claims made in the article don't address specific issues that developer may or may not face. After spending past 8-9 months developing ReaderScope, I think I can better judge these fragmentation issues from developer's point of view. I have both positive and negative opinions in this matter, but all are based on my first hand experience.

  • Backward compatibility : All the Android platform versions are backward compatible. If you developed an app for Android 1.5, then it will still work on latest and greatest Android 2.1. It may look blurry on high DPI devices, but it will work nonetheless. I have hardly heard any case otherwise. Therefore, It doesn't make sense to call all the Android devices incompatible.
  • Games : I believe Game developers are the most affected by fragmentation issues. But even then I think their major concern is differing screen sizes and input controls. Hence I don't think release of 2.0, 2.1 would have affected them if they had already updated their games for all three screen sizes as per the guidelines in 1.6.
  • Standard UI : If your app is not a game and/or you are using standard UI widgets, then it doesn't take much effort to qualify your app on newer SDK versions. I didn't have to make any specific changes to ReaderScope for 2.0 and 2.1 platforms. I know of people using it on these newer phones and aren't having any platform specific issues. I however hit a problem when I started supporting 1.6. Some users started seeing crashes when ReaderScope was writing to SDCard, it later became clear that it was due to a newly introduced permission in 1.6.
  • Google published a chart on Jan 4th this year that shows current distribution of platform versions. It seemed like a great step to alleviate this problem. Unfortunately, they haven't updated that chart ever since. Nexus one was released on Jan 5th, so that chart is pretty outdated IMO. I think Google can certainly do a better job there to help the fragmentation problem.
  • It's shocking that there are still so many Android 1.5 users. I heard from a user in Russia, that they won't be upgrading from 1.5 until May this year. That's way too long. I don't know what's the update schedule in India, but OTA updates are unheard of in India, because the phone didn't come with mandatory data plan. (Thanks to cyanogen, my Magic is running a ROM somewhere between 1.6 and 2.0.) Android 1.5 R3 came back in April 2009. So 1.5 is getting over a year old. It's high time Google/their partners start updating these poor souls.
  • The backward compatibility is a huge win, but the biggest disadvantage of fragmentation is you cannot use new features introduced in newer versions. I don't want to code live wallpapers (introduced in 2.1), but there are some great improvements in 1.6 and 2.0 that I would like to use, but can't because then I would have to drop support for 1.5 users. There is some reflection witchcraft that can help in this case, but it may not be worth it.
  • There is one surprising thing that I recently discovered by accident. The browser shipped in v1.6 doesn't support HTML5 offline caching feature. It is only supported in 2.0+ browsers. I believe that's is an important feature and iPhone seems to have had it for a long time. That's a key feature for cross platform web apps.

That's pretty much I can think of till now. Let me know in comments what are your opinions on this matter.

Ads:
Professional Android 2 Application Development
Android Programming Tutorials: Easy-To-Follow Training-Style Exercises on Android Application Development
Android Application Development: Programming with the Google SDK

Sunday, February 14, 2010

on Dropbox

I have been using Dropbox for a few weeks now. There are several solutions to address our storage issues and I have found all those solutions inadequate in one way or another. Dropbox seems to have solved most of those problems for me.

There are two important things we want to do with our data (besides creating and consuming it, of course): Sharing and Backup.

Sharing We need to share our data either with others or with ourselves but on a different computer. When we want to share data with others the first thing comes to mind is Email. If your data is of specific type, say image or video, you can use services that specialize in handling those types of data (Flickr, Picasa, Youtube). If it is the documents that you want to share, you will think of Google Docs or Zoho. If it is any arbitrary kind of data, then you may need a network drive. If the other individual you want to share the data with is in the same household or if you yourself want to access the data from different machine in the same household, you would use a NAS box. Mount that shared storage as NFS or CIFS drive on your computers. Here you need some administration expertise and need to maintain it over time.

Backup No one wants to loose their data. But we know our computers are anything but immortal. The solutions I mentioned above for sharing data, also serve as backup solutions. Moreover, if you are tech savvy, you can use mirrored RAID hard drives.

I've found that Dropbox satisfies both of the above needs and requires zero setup and maintenance efforts on user's part. Dropbox is a service provider that provides storage as a service. After you install the Dropbox software on your computer (Windows, Linux or Mac OSX), it will appear as just another folder on your computer. You can create, delete, rename a file in your Dropbox drive on one machine and the action will reflect almost immediately on other machine (depending upon the network speed). That's all. Now let me enlist what all complicated things this simple setup has solved.

  • You don't have to worry about NFS/CIFS or what data sharing protocol the service uses and if the OS on your different machines will talk that protocol or not. Dropbox uses some proprietary (!! yes, I'll come to that later) protocol and provides free clients for all platforms that seamlessly talk that protocol.
  • You can share data with others if they have Dropbox account. Imagine telling your mom that she can copy the photos she has taken in this folder on her desktop and her son will see it instantly on the opposite face of the planet. No need to upload them to Picasa or whatever.
  • Dropbox has an option called "Enable LAN sync". This is killer. If you want to share your data between a laptop and desktop that are in the same LAN, Dropbox will sync the data without going over network. I tried this yesterday - actually unknowingly, because I expected my Macbook to take much longer to sync a week's worth of git history and it did it almost instantly. I am not sure if this will work if you are not connected to Dropbox servers. The daemon on desktop might have to exchange some meta data with Dropbox servers, but the actual data transfer takes place entirely on your internal LAN, and hence is very fast. This makes Dropbox a solid alternative to a NAS box.
  • When you sign up, you get 2GB of data for free to start with. For more storage you need to pay an yearly amount. (Don't know about you, but it will take a while for my shareable data to exceed 2GB.) Moreover you will get 250MB for every person that signs up through your referral. Furthermore, it's a data storage and not a version tracking repository. So you can free some space if you hit the limit by deleting unwanted files. (I am not 100% sure if that actually frees space or not. When I have lot of data to delete I will test it)
  • Offline availability: If your ethernet/wifi connection breaks, the NAS share on your machine will be inaccessible to you. That's not the case with Dropbox. You can still access the files in your Dropbox folder even when you are offline - just that they won't be up to date.
Dropbox talks a proprietary protocol. The client daemons are closed source too. These days "open" has become such a fashion statement that few people care to find its relevance in a given context. Here are two aspects of the Dropbox service that make me feel safe when putting my data in it.

  • Lock in - This is a major issue with document storage services like Google Docs or online MS Office. You need to make sure that they have the ability to export their document in a format that can be opened by other software of your choice. Creately is a great product, but I don't want to use it to draw my flowcharts because it saves the doc in a proprietary format. I can only export it as PNG image. I would have used it, if it had an option to export to SVG. By the nature of its service Dropbox doesn't have lock-in problem. Your files are stored as raw data, so there is no worry of format lock in.
  • Evil/Bankruptcy - In case Dropbox goes bankrupt overnight, or gets bought by someone evil and shuts down their servers except for paid customers, do we loose our data? The "Offline Availability" feature of Dropbox will let you access your data on your local machine, even if the Dropbox server is not reachable. Now it is arguable, if Dropbox can plant a malware in their proprietary daemon to sabotage your data or make it inaccessible. I leave it to you to decide if a popular service provider will do such a thing on purpose. (If you think it can, you may want to stop using Gmail)

I hear Dropbox has an iPhone app, but without iPhone I can't check it out. But they are soon publishing Android and Blackberry apps, so I will review it then. They do have mobile-friendly web site though.

So overall, I think Dropbox is a great service to solve our storage worries.

Having said that, there are some minor issues that I've found or don't know enough about that may concern some of you.

  • Dropbox can share files across Linux and Windows, but I don't know how that affects access control bits on those files. I can see the -rwx- fields on my files alright even when I put them in Dropbox. I don't know if they affect when the file is modified from a Windows machine (I don't use Windows myself). I have been using Dropbox as my Git repo for few weeks and I haven't found any problems doing that.
  • On a Windows machine, the installer is little unclear when dealing with multiple accounts. I installed it from an Admin account on my parents' laptop, but it didn't show up in my parents' account that have no admin privileges. I had to temporarily give admin rights to those accounts, install Dropbox and revoke the rights later. It worked alright after that.
I have used the service only for a month, so I may or may not find things in future that may change my impression of the service. Never say never. But so far, I've found Dropbox to be the best solution for data sharing and backup.

(There is a competing service named Sugarsync, but I haven't tried it. I think it lacks support for Linux, so no-go for me.)