0

I have a SQLite DB with 20,000 records. I cannot load the DB in the Emulator and it Force Closes on some installed devices. I can load the full DB on my Test Device (HTC Inspire).

I have cut down the records to apprx 5,000 records and distribute the app and it installs and runs on the Emulator, other devices and my HTC with no problems. But I have sacrificed considerable content.

I am looking for a "strategy" that will optimize the number of records that can be installed on different devices.

How would you create and distribute an Android App with a pre-existing database to achieve the greatest number of installed records?

Is there some magic way to know what the capacity of the device is that will help my situation?

TIA

Trey Balut
  • 1,355
  • 3
  • 19
  • 39
  • Do you have Blobs in your database? Are they, size-wise, the biggest part of database? – Peter Knego Sep 28 '11 at 22:14
  • When it force closes, what is the exception? – David Snabel-Caunt Sep 28 '11 at 22:24
  • Peter, There are no blobs, 4 text fields, on description field limited to 250 characters. I will have to check on the Force Close exception. – Trey Balut Sep 28 '11 at 22:35
  • try this? http://stackoverflow.com/questions/3016606/loading-sqlite-database-into-android-app – Lily Sep 29 '11 at 00:19
  • Here are the messages I get when I try to copy a DB that is too large to load from the assets to /data /data/ [packagename]/database. 09-29 03:00:23.973: DEBUG/asset(17739): Data exceeds UNCOMPRESS_DATA_MAX (2686976 vs 1048576) 09-29 03:00:23.973: WARN/System.err(17739): java.io.IOException 09-29 03:00:23.973: WARN/System.err(17739): at Android.content.res.AssetManager.readAsset(Native Method) – Trey Balut Sep 29 '11 at 03:06
  • Hope this formatting is better. My Error msgs. 09-29 03:00:23.973: DEBUG/asset(17739): Data exceeds UNCOMPRESS_DATA_MAX (2686976 vs 1048576) 09-29 03:00:23.973: WARN/System.err(17739): java.io.IOException 09-29 03:00:23.973: WARN/System.err(17739): at android.content.res.AssetManager.readAsset(Native Method) – Trey Balut Sep 29 '11 at 03:14
  • 2
    Try to rename the db file *.jpg or *.mpg as suggested here: http://stackoverflow.com/questions/5789177/i-get-this-error-data-exceeds-uncompress-data-max-on-android-2-2-but-not-on-2-3 – loc Sep 29 '11 at 11:51
  • Loc, your solution of changing the name of the db to a "jpg" worked. Thanks for the solution. – Trey Balut Oct 01 '11 at 06:20

1 Answers1

1

One can load db effiecently of records up to 40,000.Try to load database at the beginning and only once in a public static array and access throughout your app.