I have an android application that takes a static GTFS data that I manually turned into a database.
How do I update this GTFS data automatically, or is that not possible?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
There is not to my knowledge any ready-made, reusable solution for doing this. However, I can share what I've done in the past.
There are three parts to what you're trying to accomplish:
Automatically detecting and downloading updates to the GTFS feed. A simple approach might be to subscribe (in a feed-reader) to the RSS feed published by GTFS Data Exchange for your agency, which will at least help you know when new data is available so you can manually prepare an update for your app. A completely automatic approach might require the development of a custom tool to poll either the RSS feed or the transit agency's website directly to recognize when new data is available, then download and process it.
Generating a new database from the downloaded data. Here there are some existing resources you can leverage. I myself have written a small utility in C that generates a SQLite database from a GTFS feed; you could perhaps use this as a starting point and modify it to work with your own database schema. If you'd rather stick with Java, the OneBusAway project publishes a number of developer tools you might find useful, including a Java library for working with GTFS data in CSV format.
Deploying the updated database to your users. If your app is designed so it accesses transit data through an API hosted on your own server, this may be as simple as copying over the new database and restarting the app server. If your app instead reads from a database installed on the device itself, pushing updates may be more difficult; I'll have to defer to someone with more experience publishing Android apps in that case.
None of these things is terribly difficult, but it is true that keeping the data used by a transit application up-to-date requires essentially a whole other application itself.