2

i have my_songs table, include columns:

 id (int)
 name (varchar)
 title (varchar)
 photo_url (string)
 lyrics (string)
 date (date)
 info (string)
 genre (varchar)
 file_size (int)
 mp3_url (string)

my tables include 10,000 rows. i use volley library to load songs list in my listview in my app:

 select id, name, title, photo_url from my_songs limit 1,20 .....

and when user click on listview item:

 select * from my_songs where id = click_item

enter image description here

now, which is better for listview mysongs list arrayList:

A.

 class songsListModel() {
      int id;
      string name;
      string title;
      string photo_url;
 }

 List<songsListModel> songs_list_for_listview = select id, name, title, photo_urel from my_songs;

or

B.

 class songsListModel() {
      int id;
      string name;
      string title;
      string photo_url;
      string mp3_url;
      string genre;
      string date;
      string lyric;
      string info;
      intfile_size;
 }


 List<songsListModel> songs_list_for_listview = select * from my_songs;

I do not want for click on item request on server for other song details such as lyric, mp3_url, genre and .....

In A method, High data volume in the array, It does not cause any problems? which is better?

1 Answer 1

1

From my perspective option A. is better than B. , Because on that request user will less time to see the list. And when they click then you can play the song and parallelly load the other information about the song. So, User will not get bored to see the loading.

2
  • If you find the answer is helpful you can accept the answer . Jun 2, 2016 at 7:45
  • 1
    You Welcome :) @grizzly Jun 2, 2016 at 7:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.