简体   繁体   中英

How to read/convert DBF files so they can be used in Android?

I have an old dBase II database file that consists of around 70.000 rows with 8 columns per row. This comes down to around 10 MB of data, which is nothing out of this world. Data will only ever be read from this file, never added to, or updated. So my question is:

What is the best approach to utilize the data in an Android Platform (in the most optimal way possible)? Should I convert it all to SQL and then import it into SQLite on the device, or are there any other (better) alternatives?

What about the performance of the device? Should data be queried "continuously" (short intervals)? Would it consume a lot of resources?

I have an old dBase II database file

Old? I had hair when I used dBase III, and even I'm not so old as to have used dBase II. I would use "prehistoric" as the adjective, as "old" does not do it justice. :-)

that consists of around 70.000 rows with 8 columns per row. This comes down to around 10 MB of data, which is nothing out of this world

No, but it is a bit on the large side for what you normally see in the mobile realm today.

What is the best approach to utilize the data in an Android Platform (in the most optimal way possible)? Do I convert it all to SQL then import it into SQLite on the device or are there any other (better) alternatives?

Well, I'd certainly use SQLite, so that you can quickly load relevant subsets. However, since the data is static, you can do the conversion on your development machine. Then, you can use SQLiteAssetHelper to package the data with your app, or download the database from some known URL on first run of your app if you prefer. This avoids having to do the conversion on a slow, memory-constrained, battery-powered device.

What about the performance of the device should data be queried "continuously" (short intervals)? Would it consume a lot of resources?

Yes, doing lots of disk I/O will consume battery. Try to cache data where possible. Particularly since the data is unchanging, implementing cache algorithms should be fairly straightforward.

Talking about dBase II reminds me of the true original, Vulcan.... I did start with dBase II though. As for the subject: You can export your data to either HTML, to XLS, to CSV etc. and read it easily on your Android device. In order to do that you can use the 100% Freeware (I wrote it) EGBrowse to be found at:

http://perso.wanadoo.fr/eitang/files/egbrowse.zip

A single EXE file. Requires nothing, writes nothing except in its own folder and it is 100% portable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM