Android Question List Sorting

wonder

Expert
Licensed User
Longtime User
Hey guys,

I have a few questions about lists.

1. What the maximum number of items (int values) a list can support.
2. To sort a big big big list, what's the best method/algorithm? Bubble sort? Quick sort?
3. Is it feasible to import 8 megabytes of data to a list and sort it?
4. Am I asking silly questions and should I just learn how to "database", mySQL and such? :D
 
Last edited:

wonder

Expert
Licensed User
Longtime User
It could be, for example CSV values.
Username, Score, Endurance Time.
B4X:
user000001, 12, 8329
user000002, 17, 12329
user000003,  8, 3593
...
user999998,  5, 589
user999999, 12, 10384
Sort by highest score. Endurance time as a tie-breaker.
If the score is the same, the highest ranked user is the one with the highest endurance time.

Anyway, I'm starting to realize I really have to take the "database-on-a-server" path.
My initial idea was to have my game downloading the entire scoreboard, updating it, sorting it, displaying it and re-uploading it using lists.
This could be fine for a few dozen users, but if I ever reach thousands, I guess this system would break.
 
Upvote 0

inakigarm

Well-Known Member
Licensed User
Longtime User
Db estructure permits great flexibility: Sorting By highscore and endurance time is very quick and easy with SQL (sqlite or MySQL)
 
Upvote 0

RandomCoder

Well-Known Member
Licensed User
Longtime User
While we're on this subject, what is the preferred database? I recently installed MySQL, but only yesterday I read this post MySQL Library about licensing when using a JDBC driver. Does this rule out using MySQL in any Apps we intend to sell? I've not looked properly into it yet but would appreciate a simple answer.
 
Upvote 0
Top