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.

Update 2: I made Caltroid project page.

Screenshot: Caltroid 0.1 - Caltrain Schedule for Android

Similar Posts:

    None Found


  1. vamsi:


    Application is superb.
    I did n’t get it .. cann’t be resolved .

    Plz send total project zip i will load in eclipse.

    by vamsi

  2. heikki:

    I uploaded a zip:

    Please note that I work on Linux, so you will have Linux newlines etc.

  3. matti:

    Hei 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. 🙂

  4. Todd:

    Nice app,
    I’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.

  5. heikki:

    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.

  6. Bill Travis:

    I love your Android CalTrain App (which can not be found using the Market “Search” utility.) I am a casual CalTrain user and I found your App by accident. I am a 100% transit user. Your CalTrain Androind app may not be perfect but it helped me.

    I’m old and have a lot of time on my hands. I can type tables if you can make sense of them and make the data useful. If you need data entry assistance, ask and I’m yours.

    I’ve looked at Android SDK a little but, at this time, I would rather let people that know what they’re doing do what they do. I’m from the days of Fortran and Cobol. The highlight of my Senior year in High School was the delivery of a PC that could play Pong…nothing else, it played Pong. BUT, I can enter massive amounts of data, easily, with no problem.

    If you want help, I’m volunteering.

  7. Bill Travis:

    P.S. MTA should be paying you.

  8. Bill:

    As a user, the App is great. I am an accountant that lives in SF. I’m great at data entry and would love to help improve this app. It helped me. It is useful!

  9. Heikki Toivonen:

    @Bill: Thanks for the nice words. I didn’t actually know that the current version would run on the Android devices out there. I started updating it to the latest SDK, but have just been too busy with other projects. I’ll try to find some more time to finish the update. As for help, at this point I don’t need data entry help since I wrote a screen scrape program that gets the schedule from the Caltrain site. Also, Caltrain is participating in a Google-initiated effort to provide schedules in machine readable format, so I might look into switching to that data feed in the future. Something that would definitely be useful, though, would be to send me feedback on the application: what does not work, what kind of features would you find useful, and so on.