I am brand new to Basic4Android and android.
I am trying to read in a fairly large database file (a table of 27 columns and 2000 rows).
I tried with the (slightly modified) "SqlDemo" program from the tutorial and also with the SQLiteDB program from Klaus CHRSITL.
Both however terminate with a java.lang.OutOfMemoryError somewhere between reading the 1000th and 2000th row.
I know it is a whole lot of data, but it is only text, so expressed in bytes, with todays memory chips this should be barely worth mentioning. So I guess it must be the graphical representation (Scrollview?) eating that memory.
If I look at the RAM usage on my android tablet I indeed see a whole bunch of used memory, but nevertheless there also remains a lot of memory unused.
So my question:
- Is there a way I could increase the amount of memory an application gets?
- Is there perhaps a more memory efficient way of showing a (scrollable) table of text?
Thanks for your reply. Please find the project in the zip attachment. It is essentially just your SqlDemo as you will see. The database is just a dummy for now, but the columns are correct and the number of rows are also according to the target. It all still needs to be tweaked and tuned and updated, but then first i must be certain it is do-able! I only want to develop for my 10.1" tablet, so I do not have to be concerned about different sizes (or memory issues, I thought)
You are trying to add about 28,000 views. This is apparently too much.
It will also be very hard for the user to handle such a giant table.
You should instead either show a smaller part each time or use DBUtils.ExecuteHtmlTable.
Hmm... no doubt the user will need, and often use, a good filter, sort or search button, but nevertheless the possibility for scrolling through everything is required when he "just cannot recall that name" for the moment.
Perhaps I should take a closer look to this DBUtils.ExecuteHtmlTable, but i was trying to avoid this, as it seems more difficult for me to let it co-operate with the rest of the Basic4Android program.
Perhaps I should take a closer look to this DBUtils.ExecuteHtmlTable, but i was trying to avoid this, as it seems more difficult for me to let it co-operate with the rest of the Basic4Android program.