Caltroid 0.1 - Caltrain Schedule for Android
I finally finished my first Google Android application which I started about 15 days ago, which was much, much longer than I expected it would take and I am still not totally happy with the way things turned out. (I did not work every day, nor did I spend full days at it, but still it compared to the 12 hours it took to create similar Python+Tkinter application it was certainly a disappointment.) Of course, this being my first Java program I guess I should not have expected miracles. My second post on the subject shed some early light on the issues I was facing.
I can sum my major Android frustrations as follows:
- XML is required for UI
- No drop down list control (I used Spinner instead)
- No multicolumn list control (I used GridView instead)
I also run into some bugs, like some bug in GridView that caused crashes whenever the layout changed. Luckily there was a simple workaround with focus.
I quite liked the Eclipse plugin for Android development.
So what is the application I created? Since I have been learning new technologies by creating Caltrain schedule applications (previously with Python and Javascript), I figured I should do the same with Android. And thus Caltroid was born. It has one additional feature compared to the other schedule applications, in that it can automatically find the nearest Caltrain station using GPS information. It is not bug free (what would you expect with 0.1 release) but I think it would already be useful to someone with an Android device.
You can get the source with Subversion.
Update: You can download the complete project directory with Caltroid.apk and all. Grab your copy here. Please note that I work on Linux so files will have Linux newlines.

HI,
Application is superb.
I did n’t get it ..
R.java cann’t be resolved .
Plz send total project zip i will load in eclipse.
ok
vamsi - February 6th, 2008 at 10:43 pmby vamsi
I uploaded a zip: http://www.heikkitoivonen.net/files/Caltroid-0.1.zip
Please note that I work on Linux, so you will have Linux newlines etc.
heikki - February 6th, 2008 at 11:08 pmHei Heikki. That is pretty cool! Now we need “Stucktroid” that gets you out of the parking lots also known by their alternative names as 101, 280, 880, etc. and automagically gives you alternate, normally little known but better routing to our destinations.
matti - February 11th, 2008 at 12:13 pmNice app,
Todd - April 2nd, 2008 at 9:31 amI’m working on a similar idea that is generalized to any public google transit data feeds. Regarding your desire for a better list view (ie - more than a single column), it’s not too hard to do. You simply define your own ‘layout’ in res with a couple of textviews and then reference that id when building your adapter. If you use an ArrayListCursor for your data, and then build a SimpleCursorAdapter from that as the backing data for your spinner, you can match column ids to your textview ids to control how your data is displayed.
Cheers,
Todd
Thanks Todd. And yes, I know I could do my multicolumn list, but since I am pretty sure this is such a common need that Google will provide such a thing I decided against implementing it. Same with better emulation for drop down lists.
While working on this I also realized a lot of the Caltrain schedule functionality would be applicable to other schedules, especially simple daily commute transits like with Caltrain. It is great to hear you are working on a more universal solution, and given that many public transportation organizations are now offering schedules in Google Transit format it is a good move to concentrate on that.
heikki - April 2nd, 2008 at 10:27 am