0

I'm trying to create an android train app using a text file saved as .xml

This file contains all the time, arrival, depature, station number and etc inside it. But the problem is the file is larger than 90mb and there's over 20 files of these. How do I use it and open them and show them each one under the right title.

anyone help with a open source I can see..

thank you.

Wally
  • 47
  • 1
  • 6
  • Android won't let you exceed 16mb of heap in your app - so you're going to have to find a way to load and display the chucks of data in a more filtered way. – Noah Jan 11 '12 at 18:38
  • Just an idea, have you thought about putting the data into an SQLite DB. I'm not sure of the maximum size of SQLite databases in Android, but I think its over 1 gig. –  Jan 11 '12 at 18:38
  • Is it necessary for your app to have access to the data even when offline (no WiFi or 2G/3G... connection)? – Robert Jan 11 '12 at 18:45

2 Answers2

0

If I am not wrong; when you ran this heavy file your application might be crashed.

You have to use the Web Service for that. and parse the data through JSON or XML and you will fetch data like ..

Station >> Train >> Arrival >> Departure in this format.

NovusMobile
  • 1,813
  • 2
  • 21
  • 48
0

Using all the XML data every time your app will be used is a bad idea because of the high processing time which would be estimated several minutes for processing all files.

Using the SAX parser it is possible to process and possibly convert the XML input files. The best way would be to convert them to a SQLite database.

This can be implemented on the device using the mentioned SAX parser (see also How to parse XML using the SAX parser) and writing the data to a well designed SQLite database.

Of course you could also convert the data on a desktop PC and provide the converted SQLite database to your App users - but that depends on the data and their license.

Community
  • 1
  • 1
Robert
  • 39,162
  • 17
  • 99
  • 152
  • I have a Data license & a login ID to gain updated xml files. I don't know how to use SQlite or convert them . What's the best way to do this. Thanks – Wally Jan 11 '12 at 19:59
  • DO you know how databases work (tables, rows, columns, ...)? SQLite is just a special form of it. If you want to learn how to use it on android search Stackoverflow for [android] [sqlite] - there are a lot of topics containing sample code. – Robert Jan 12 '12 at 08:37
  • thanks for the help. I'm gonna treat this as the best answer. Thank You again – Wally Jan 12 '12 at 14:37