3

This is not an optimal solution, but I'm working on an Android app that must consume GTFS-Realtime data as an API is not available. The datasets will be small, the max # of vehicles being tracked at one time will be 8-10, or I would consider building my own API.

Since the common practice is to consume GTFS-Realtime data from a server which exposes an API, I can't find any good examples of implementing the "gtfs-realtime.proto" to process Google's protocol format on the mobile device

My Question: Are there any open projects that demonstrate consuming GTFS-Realtime using the protocol buffer format implementation using Android Natively? I checked github and most everything leads to OneBusAway, which requires their API which I'm not interested in using.

The closest implementation I've seen is this sample done in Ruby: https://github.com/reidab/trimet-gtfs-realtime

Or a Java version of Ruby's "Beefcake" would be a start.

CampbellGolf
  • 812
  • 12
  • 27

1 Answers1

1

Have you tried just using the vanilla OneBusAway GTFS-realtime API module?

https://github.com/OneBusAway/onebusaway-gtfs-realtime-api/wiki

It just contains the Java classes generated from the GTFS-realtime proto and should be pretty straightforward to use for parsing a GTFS-realtime feed. Granted, I've never tried using the module within an Android app.

Brian Ferris
  • 7,557
  • 5
  • 25
  • 27
  • I came across that before I posted. I'll research it a little more, and will keep hunting. – CampbellGolf Jun 12 '12 at 20:33
  • This article answers the mail, exactly what I'm looking for, I was too wrapped up in specific GTFS implementations, that I overlooked "Buffer Protocol" for android. http://wweems.blogspot.com/2010/09/google-protocol-buffers-in-android.html – CampbellGolf Jun 12 '12 at 21:27