Android Question ScrollView2d disappeared (Solved)

Shelby

Well-Known Member
Licensed User
Hi All,
In my SQLite db app, suddenly the DB shows the following error message when I run it :

[CODE
B4A Version: 11.00
Parsing code. Error
Error parsing program.
Error description: Unknown type: scrollview2d
Are you missing a library reference?
Error occurred on line: 231 (Table)
Private SV As ScrollView2D
[/CODE]
I don't know how to make the type known or why anything changed. Here's my app zipped. Can you see the problem?

Thanks
 

Attachments

  • SS2021V11.zip
    53.7 KB · Views: 293
Last edited:
Solution
Thanks for your patience Klaus. I'd love to donate $100 to your bank account but you said no before.
Thank you for your proposal, but my mind has not changed it is still and will remain no thank you.

I have updated the Table class to version 3.30 including a check that all values in the column to sort are valid numbers for numeric sorting.

Attached you find a modified version with the latest Table Version.
In your project you used version 2.19, the latest version now is 3.30, lot of things had changed in the mean time.
I also removed the wrong line in your database.

klaus

Expert
Licensed User
Longtime User
Thanks for your patience Klaus. I'd love to donate $100 to your bank account but you said no before.
Thank you for your proposal, but my mind has not changed it is still and will remain no thank you.

I have updated the Table class to version 3.30 including a check that all values in the column to sort are valid numbers for numeric sorting.

Attached you find a modified version with the latest Table Version.
In your project you used version 2.19, the latest version now is 3.30, lot of things had changed in the mean time.
I also removed the wrong line in your database.
 

Attachments

  • SS2021V11New1.zip
    82.3 KB · Views: 199
Upvote 1
Solution

Shelby

Well-Known Member
Licensed User
OK, Thanks for your thorough updating of my project. All of us here on the forum will forever be indebted to your dedication to fulfilling the needs of all. Of course, the other forum experts always add valuable assistance as well and I wouldn't want to leave them out so I say thanks to all of you. Yes of course Erel, that means you too.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Thanks for your thorough updating of my project

First and foremost I hope you are doing better after your Covid bout. Getting your health back is more important than any app you succeed to write.
Now that you have a complete running app thanks to the tireless efforts by klaus, I looked at the final complete app and would like to recommend a few things:
1. You have 2 files in the files tab: Scrollview2D.b4xlib and scrollview2D. jar. You need to remove those two files. They are irrelevant to your app.
2. In your Starter service, you are deleting the database every run and copying it from Assets to your DBFileDir. You need to remove that line or comment it. It is ok in the early part of the testing, but no longer.
3. Your project can easily be designed for B4XTable, so you avoid all that vertical scrolling you have to do now when you have many records. And B4XTable has a search box feature, sorting and many more neat things. You will still continue to get the help you have been enjoying to date.
4. xCustomListview is another nice option. Both xClv and B4XTable are newer. Just something for you to think about down the road.
5. And finally, later when you are comfortable, and the time is ripe, you may want to consider embarking in B4XPages.
 
Upvote 0

Shelby

Well-Known Member
Licensed User
Thanks, I have done just as you suggested. I commented the line:
'File.Delete(DBFileDir, DBFileName)
I assume that it is the one responsible for the problem you perceive in your #2 suggestion above. However, I now see a bunch of colorful new areas and a new scrolling up and down slider with multiple descriptions. I'm not sure I object so far. I'll check it out.
Thanks for the kind words about my virus. It's very slow to be reduced in intensity. I'm at day 8 since my symptoms started last Sunday. I'm hoping to be cleared of it in 2 to 6 more days.
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
I had not looked that far:
I fully agree with points 1 and 2.
I do not fully agree with points 3 and 4.
There are drawbacks with B4XTable and xCustomListView, at least for me.
B4XTable is page based and this is cumbersome with many records.
xCustomListView can be scrolled only vertically not horizontally limiting the data per row.
The Table class scrolls in both directions and it has a fast scroll feature making scrolling over many records very easy.
With the Table class version 3.30 you can also remove these two files sort_asc.png and sort.desc.png from the Files Manager Tab.
Point 5, of course, might be a next step.

However, I now see a bunch of colorful new areas and a new scrolling up and down slider with multiple descriptions.
These areas are the fast scroll feature. You have a vertical slider on the right side allowing to scroll over the entire list and a Label showing the text in a given column, column 0 in your case, of the row in the middle of the screen.
All these properties can be changed.
Another improvement, as the Table is now a CustomView, is adding the Table in the Designer like in the attached project.
With the advantage that you can set all properties in the Designer directly.
I played a bit with the properties.
I have also updated the Table class to version 3.31 in your project, not yet published, because I saw some small problems playing with your project.

1633357417610.png


I wish you also a good recovery.
 

Attachments

  • SS2021V11New2.zip
    56.2 KB · Views: 193
Last edited:
Upvote 0

Mahares

Expert
Licensed User
Longtime User
If you insert a record in the table as an example below:
B4X:
Dim strQuery As String = "Insert into TableList221 values(?,?,?,?) "
    Starter.sql.ExecNonQuery2( strQuery, Array As Object("Testing", "T1", "P1", Null))
Then change the query from:
B4X:
tblItems.LoadSQLiteDB2(Starter.sql,"SELECT DescriptionSubjectLookup, TableNumber as [Table], PageIRC As [IRC Page], PgPDF As [PDF Page] FROM TableList221", False, Array As String("T", "T", "T", "I"))
to this using IFNULL, you can still sort without having to disable the sorting for that column. Right now you have to hunt for that record to find it in the table.:
B4X:
tblItems.LoadSQLiteDB2(Starter.sql,"SELECT DescriptionSubjectLookup, TableNumber as [Table], PageIRC As [IRC Page], IFNULL(PgPDF, 0) As [PDF Page] FROM TableList221", False, Array As String("T", "T", "T", "I"))
 
Upvote 0

Shelby

Well-Known Member
Licensed User
Good Morning Guys,
Klaus, with the new project you gave above, I'm getting a:
beginning of crash line of text in my logs tab; after which the project seems to compile ok. Secondly, I don't understand the helpfulness of that vertical scroll bar you have an image of above. I did start seeing that scroll bar yesterday in your previous project. By the way, the numerical system in the second column is other than optimal but I must leave it that way since the 900-page book where I am taking these from used a system which is not numerically correct.
 
Upvote 0

Shelby

Well-Known Member
Licensed User
If you insert a record in the table as an example below:
I have found it super easy to enter or remove a new record when using my DB Browser. I'm not sure if your suggestion has any relevance for me. Maybe you can elaborate about the use if you think I'm wrong.
 
Upvote 0

Shelby

Well-Known Member
Licensed User
And B4XTable has a search box feature, sorting and many more neat things.
Oh, Goodie, I have been hoping to have a search feature in the coming weeks or months. My nausea is bothering me again so I think I'll lie down again for a while. I've only been up for 2 hours and already I'm in bad shape. It's 7 am here.
Thanks
P.S. The one additional feature I'm shooting for in the final version of this project is to have a 4th column where each record points to an image. In the past 2 months, I have completed my repository for my PNG images and it awaits implementation.
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
@Mahares
Thank you for the explanation.

I fully agree with you. The main problem is the database.
And your query avoids the problem. In the project I posted in post #41 I had removed the wrong line.

I added the check to avoid that the program crashes.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
@Shelby
I suppose that the two lines in the Logs are these:
Unexpected event (missing RaiseSynchronousEvents): sv2_scrollchanged
Check the unfiltered logs for the full stack trace.

Do not be worried about these lines, they are harmless. I had asked in the forum about this and that was Erel's answer.

The vertical cursor is a fast scroll cursor, when it appears, touch it and move it.
This allows a very fast scrolling over the entire list without the need to scroll and scroll and scroll with the finger.
In the Label moving with the cursor you see the content of the row which is in the middle of the screen.
You can choose the column of which you want to display the content.
For small lists it is not displayed, you can set the min number of rows for its display, the default value is 50.
This means that, by default, in a list with less than 50 rows the fast scroll cursor is not displayed.

If you do not like and you do not want it you can uncheck the FastScroll property in the Designer.
 
Upvote 0

Shelby

Well-Known Member
Licensed User
If you insert a record in the table as an example below:
B4X:
Dim strQuery As String = "Insert into TableList221 values(?,?,?,?) "
Starter.sql.ExecNonQuery2( strQuery, Array As Object("Testing", "T1", "P1", Null))
Then change the query from:
B4X:
tblItems.LoadSQLiteDB2(Starter.sql,"SELECT DescriptionSubjectLookup, TableNumber as [Table], PageIRC As [IRC Page], PgPDF As [PDF Page] FROM TableList221", False, Array As String("T", "T", "T", "I"))
to this using IFNULL, you can still sort without having to disable the sorting for that column. Right now you have to hunt for that record to find it in the table.:
B4X:
tblItems.LoadSQLiteDB2(Starter.sql,"SELECT DescriptionSubj
Maybe your coding above is used to enact the search option. That would be great If I'm correct.
My users will never have the ability to add anything to the app. That's what I thought you meant when I first saw your code.
 
Upvote 0

Shelby

Well-Known Member
Licensed User
@Shelby
I suppose that the two lines in the Logs are these:
Unexpected event (missing RaiseSynchronousEvents): sv2_scrollchanged
Check the unfiltered logs for the full stack trace.

Do not be worried about these lines, they are harmless. I had asked in the forum about this and that was Erel's answer.
No, Klaus, those lines are no in my logs tab. Every time I start to make a screenshot, the logs tab disappears. I'm trying to get another solution to display the crash wording. Now it's not showing the crash. As usual, I'm confused.
 
Last edited:
Upvote 0

Shelby

Well-Known Member
Licensed User
Got it; here's the crash screenshot
 

Attachments

  • New db crash screenshot.png
    New db crash screenshot.png
    112.6 KB · Views: 158
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Maybe your coding above is used to enact the search option. That would be great If I'm correct.
My users will never have the ability to add anything to the app. That's what I thought you meant when I first saw your code.
Those lines were meant for klaus to test, not for you. They will not be in your app.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Sorry, but I am lost.
In your screenshot in post #54 there is no crash.
So what is the problem?
Does the project I posted in post #45 work yes or no ?
If no, what is the problem ?
But from your posts it seems that it works or worked.
So, to know what happens, you need to be much more precise in your questions.
What have you done?
What changes did you make ?
In what conditions does the problem appear.
These are the information I need in trying to understand what happens.
 
Upvote 0

Shelby

Well-Known Member
Licensed User
On the far right side of the screenshot it says:
beginning of crash
beginning of system
 
Upvote 0

Shelby

Well-Known Member
Licensed User
The vertical cursor is a fast scroll cursor, when it appears, touch it and move it.
This allows a very fast scrolling over the entire list without the need to scroll and scroll and scroll with the finger.
I guess I can see the usefulness now.
 
Upvote 0
Top