【发布时间】:2016-10-01 18:42:47
【问题描述】:
我有my_songs 表,包括列:
id (int)
name (varchar)
title (varchar)
photo_url (string)
lyrics (string)
date (date)
info (string)
genre (varchar)
file_size (int)
mp3_url (string)
我的表包含 10,000 行。我使用volley 库在我的应用程序的列表视图中加载歌曲列表:
select id, name, title, photo_url from my_songs limit 1,20 .....
当用户点击列表视图项时:
select * from my_songs where id = click_item
现在,哪个更适合listview mysongs list arrayList:
答。
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;
或
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;
我不想点击服务器上的项目请求以获取其他歌曲详细信息,例如lyric, mp3_url, genre and ....。
在A方法中,数组中的数据量很大,不会造成什么问题吗?哪个更好?
【问题讨论】:
标签: android mysql arrays database listview