Android Question Table CustomView very slow after Android update to 9(pie)

MarcRB

Active Member
Licensed User
Longtime User
Hello,

I do have an (old) big company app still using Table Customview.
Since my customer updated his tablet to Android 9 the activities with Table customview are very slow.
There is a delay for about 10 seconds now. What causes this hugh delay? Is it in Table Customview of maybe do I have to set some new runtimepermissions?

Because i'm busy to write a new app for this app (with modern tables), I don't want to make big-time changes to that old project.
Is there a simple way to resolve this, without having to replace all the Table Customviews?
 

Peter Simpson

Expert
Licensed User
Longtime User
When it comes to tables, I recommend that you start using xCustomListView with lazy loading.

There is no reason why a new tablet would in theory would load tables slower than an older tablet not unless the quality/specs of the new tablet is just terrible.

The lazy loading example on the forum by Erel works well, but I've modified it for my clients so that it loads data 250 lines at a time from the database before continuing with populating the table, it makes for smooth continuous scrolling.

@MarcRB you should start of by searching the forum for 'lazy loading'.
 
Upvote 0

MarcRB

Active Member
Licensed User
Longtime User
[QUOTE="you should start of by searching the forum for 'lazy loading'."[/QUOTE]

That's the one I chose for my new projects.

But in this case I like to solve the delay without having to replace my 8 tables in 8 activities.
Maybe there is some trick, the solve this. In one month my new app comes replacing this one.
 
Upvote 0

MarcRB

Active Member
Licensed User
Longtime User
I'm not allowed to post the complete project but I do have some snippets...

Rows: about 2000
Cols: 11
Fill: SqLite database

TableCustomers.UseColorStatus = False
TableCustomers.UseColorVisit =False
TableCustomers.Initialize(Me, "TableCustomers")
TableCustomers.InitializeTable(5, Gravity.CENTER_HORIZONTAL, True)
TableCustomers.CellAlignment = Bit.Or(Gravity.LEFT, Gravity.CENTER_VERTICAL)
TableCustomers.StatusLine = False
TableCustomers.StatusLineAutoFill = False
TableCustomers.AddToActivity(panDataList,0,0, panDataList.Width,panDataList.Height)
TableCustomers.HeaderColor = Colors.rgb(129,129,129)
TableCustomers.HeaderTextColor = Colors.White
TableCustomers.TextColor = Colors.Black
TableCustomers.TableColor = Colors.LightGray
TableCustomers.RowHeight = 35dip
TableCustomers.RowColor1 = Colors.White
TableCustomers.RowColor2 =0xFFB9DCF9
TableCustomers.SelectedRowColor = Colors.rgb(52, 166, 215)
TableCustomers.SelectedCellColor = Colors.rgb(52, 166, 215)
TableCustomers.MultiSelect = False
TableCustomers.SortColumn = False
TableCustomers.SingleLine = False

Dim strSQL As String
Dim intCount As Int

strSQL = "SELECT locationid as 'Loc.nr', debiteurnr as 'Deb.Nr.', project, name, ....FROM .... Order By ....."

TableCustomers.ClearAll
TableCustomers.LoadSQLiteDB(AppUtils.sqlDB, strSQL ,True)

intCount = TableCustomers.Size

TableCustomers.SetColumnsWidths(Array As Int(60dip, 150dip, 220dip, 220dip, 150dip, 70dip, 90dip, 90dip, 130dip, 170dip, 130dip))

Before the Samsung /Android update to Android 9 Pie it works fine.
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
Sorry, but I don't know why this happens.
When and where do you get this delay?
At each Button_Click?
Can you add some Logs showing the time during execution to define where the delay does come from?

I tested the demo project V2.21 on my Samsung phone with Android 9, without a delay.
My Samsung Tablet has Android 7, so I cannot test it with Android 9.
 
Upvote 0

MarcRB

Active Member
Licensed User
Longtime User
Solved!

During debug with time measurement I learned the delay was at this point "TableCustomers.AddToActivity" and after SQL fill.

Just as Claus, I tested the demo project. In my case the latest 3.02 version.
That demo was working pretty well.
I take a look at this new demo project and I noticed there was no InitializeTable in create activity.
So i changend my code, got some errors , changed it again and it was solved.

TableCustomers.Initialize(Me, "TableCustomers")
' TableCustomers.InitializeTable(5, Gravity.CENTER_HORIZONTAL, True) **** remove this line
TableCustomers.AddToActivity(panDataList,0,0, panDataList.Width,panDataList.Height) '**** make this line second line
TableCustomers.UseColorStatus = False ' **** this is for my own tweak for coloring cell by value
TableCustomers.UseColorVisit =False ' **** this is for my own tweak for coloring cell by value
TableCustomers.CellAlignment = Bit.Or(Gravity.LEFT, Gravity.CENTER_VERTICAL) 'all the other stuff
TableCustomers.StatusLine = False
TableCustomers.StatusLineAutoFill = False
TableCustomers.HeaderColor = Colors.rgb(129,129,129)
.......

Thanks all.
Klaus / Erel
 
Upvote 0
Top