Wish SQLSearchView - SearchView.BuildDatabase

Peter Simpson

Expert
Licensed User
Longtime User
Hiya Erel,
B4J SQLSearchView has a BuildDatabase method using a list (SearchView.BuildDatabase(xx, xx, List), it would be really nice if B4A and also B4i also had BuildDatabase. I was caught out this morning whilst using SQLSearchView. After creating a quick fully working example app in B4J using B4XPages, I opened the B4A project and selected the SQLSearchView library only to see the following error. That put a spanner in the works as the database is generated from a list which in turn is generated from an online API query.

B4A and B4i Error
1648810616521.png



Thank you...
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The idea behind it was that SQLSearchView solves the case where you don't want to build the index on the device as it is too slow (relevant for large indices). So you build the db index with B4J and use it on the mobile devices.

If the data is not very large then simply use B4XSearchTemplate. It will be faster. You can store the list in a database or use B4XSerializator to save it directly. If you do want to use SQLSearchView then extract the module from the b4xlib, and remove the #if B4J condition. You will only need to make a small modification in the line that initializes the SQL object.
 

Peter Simpson

Expert
Licensed User
Longtime User
The idea behind it was that SQLSearchView solves the case where you don't want to build the index on the device as it is too slow (relevant for large indices). So you build the db index with B4J and use it on the mobile devices.
Hello Erel, I see where you are coming from with the above statement. In my case the data is from an online API that returns a long list that then needs extra filtering before sending another API request.

The thing is that the B4XSerializator link below advises to use SQLSearchView, so that's what I did ;)

Okay I'll keep looking and trying solutions, but the chances are that I'll just create a solution as I don't like modifying B4X libraries as once that library has been updated I'll have to modify it again.

Thank you and have a nice day Erel ;)
 
Last edited:
Top