سؤال

I'm trying to put together a new app for a project that will display train times for the user.

I know there are a couple of ways to go about this, but before I get started I wanted to get some help from you.

My options

  1. use a webview
  2. Use a database linked to the website that has all of the data
  3. Hard code all of the times
  4. Ask the website for the data/access to the data.

This is the site: http://www.njtransit.com/sf/sf_servlet.srv?hdnPageAction=LightRailTo

I was looking in the source to see if I could find anything, but came up blank.

هل كانت مفيدة؟

المحلول

Method #4 is the best way. Request access to their webservice that gives you results in xml/json. Your Android App then parses it and then display's it according to it's UI and give users some extra features that the website can't provide.

Method 1) Use a webview - (well, technically the easiest...but if you are simply opening the webpage, why should i use your application when a browser can do the same?)

Method 2) More or less the same as Method #4

Method 3) Train schedules might change, you'll have to update your app frequently.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top