2

I am writing an Android app for my local transit authority. They publish their data in the the Google Transit Feed Specification (GTFS). I'd need to download this feed and save it to the device and allow my application to access the contents. Since the feed data has a standard specification, I figured I'd store behind a general ContentProvider serving general GTFS type data, that I could then access in a standard way.

I figure, this is a Google standard, I can't be the first to want to store and provide GTFS data on an Android phone; why reinvent the wheel, right? But, I haven't been able to find any such ContentProvider.

Does anyone know if there is an Android ContentProvider, or something similar, for storing and providing GTFS data? If not, I'll write my own; if I have to write code to store and provide transit data, I may as well make it standard; but since I'm still very much green to Android programing, I'd prefer to use a more professionally written ContentProvider, if one exists.

Marvin Pinto
  • 30,138
  • 7
  • 37
  • 54
ipetrik
  • 1,749
  • 18
  • 28
  • Did you manage to create such a ContentProvider? and if so can you share it? Btw you can convert your GTFS feed data to an SQLite 3 database using some Python scripts and then use it with your Android application using some ContentProvider specializing in SQLite. – Alex Bitek Mar 03 '12 at 20:11
  • @marvin would json work for your purposes? – s2t2 Dec 17 '12 at 05:18

1 Answers1

0

Use protocol binary format (pbf) formely google and now open source. It is compact and very fast searchable, so no need to decompress it on a device and load it into a database on that device because pbf acts as a database. Just include pbf library in your code to query it. Of course you have to compress it once before distributing the data online. Once downloaded you can use the dats in pbf offline