Launcher从第一套开发到现在已经过去了很多个年头,后续的Launcher也是和第一套Launcher使用的同一套逻辑,虽然不断的在开发新Launcher,但是逻辑代码部门缺很少改动。这也使得逻辑的代码较为混乱臃肿,其中数据库模块代码更加臃肿不利于后期开发维护。至此写篇总结,用于在后期重构过程中进行参考。
database.db数据库中涉及的表比较多一共有13张表,下面详细列出所包含的表如下:
CREATE TABLE android_metadata (
locale TEXT
);
CREATE TABLE satellite_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
disp_order int NOT NULL default 0,
name varchar(64) NOT NULL default '',
name_lan_code char unsigned NOT NULL default 0,
low_lnb_freq int unsigned NOT NULL default 9750,
high_lnb_freq int unsigned NOT NULL default 10600,
angle int unsigned NOT NULL default 0,
motor_pos int NOT NULL default -1,
unicable_index char unsigned NOT NULL default 0,
unicable_freq_index int unsigned NOT NULL default 0,
universal char unsigned NOT NULL default 1,
k22hz char unsigned NOT NULL default 2,
v12 char unsigned NOT NULL default 0,
diseqc char unsigned NOT NULL default 0,
diseqc11_1 char unsigned NOT NULL default 0,
unicable char unsigned NOT NULL default 0,
motor char unsigned NOT NULL default 0,
sat_dir char unsigned NOT NULL default 0,
lnb_power char unsigned NOT NULL default 0,
network_search char unsigned NOT NULL default 0,
fta_only char unsigned NOT NULL default 0,
hide char unsigned NOT NULL default 0,
tuner_index char unsigned NOT NULL default 0,
unicablesel int unsigned NOT NULL default 0,
transponder char unsigned NOT NULL default 0
);
CREATE TABLE audio_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
prog_id int NOT NULL default 0,
audio_pid int NOT NULL default 0,
language char unsigned NOT NULL default 0,
type char unsigned NOT NULL default 0,
dual char unsigned NOT NULL default 0,
audio_track char unsigned NOT NULL default 0,
volume_step char unsigned NOT NULL default 0,
supplementary_audio_type char unsigned NOT NULL default 0
);
CREATE TABLE satellite_transponder_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
sat_id int NOT NULL default -1,
disp_order int NOT NULL default 0,
ts_id int NOT NULL default 0,
on_id int NOT NULL default 0,
freq int NOT NULL default 0,
sym_rate int NOT NULL default 0,
pol char unsigned NOT NULL default 0,
fec char unsigned NOT NULL default 0,
fast_scan_num int NOT NULL default 0,
transpec char unsigned NOT NULL default 0,
modulation char unsigned NOT NULL default 0,
spilot char unsigned NOT NULL default 0,
tuner_index int NOT NULL default 0,
stream_code int NOT NULL default 0,
stream_type int NOT NULL default 0
);
CREATE TABLE box_info_table (
trans char not null default 5,
ttx_trans char not null default 5,
brightness char not null default 127,
contrast char not null default 127,
saturation char not null default 127,
hue char not null default 0,
sharpness char not null default 0,
osd_language char not null default 0,
osd_style char not null default 0,
epg_style char not null default 0,
ver_offset char not null default 0,
hor_offset char not null default 0,
ahead_on_off char not null default 0,
yt_region char not null default 0,
password varchar(4) default '0000',
service_lock char not null default 1,
vol_level char not null default 0,
mute_state char not null default 0,
vol_per_ch char not null default 0,
sat_select char not null default 0,
cur_sat char not null default 0,
channel_state char not null default 0,
audio_language char not null default 69,
epg_language char not null default 69,
sub_language char not null default 69,
fav_list_tv_mask char not null default 0,
fav_list_radio_mask char not null default 0,
fav_type char not null default 0,
tv_state char not null default 0,
fta_mode char not null default 0,
fta_select char not null default 0,
tv_type char not null default 0,
tv_format char not null default 0,
auto_ch char not null default 0,
auto_exit_ch char not null default 0,
network_search char not null default 0,
audio_tone char not null default 0,
video_mode char not null default 0,
apd char not null default 0,
scart char not null default 0,
spdif_mode char not null default 0,
hdmi_mode char not null default 0,
cec_auto_standby char not null default 0,
hdmi_control char not null default 0,
help_mode char not null default 0,
recall_history char not null default 0,
pip_mode char not null default 0,
uart_mode char not null default 0,
time_zone char not null default 0,
time_mode char not null default 0,
summer_time char not null default 0,
longitude_dir char not null default 0,
latitude_dir char not null default 0,
longitude_angle int not null default 0,
latitude_angle int not null default 0,
rotating_speed_motor int not null default 0,
timeout char not null default 2,
bg_timeout char not null default 2,
standby_mode char not null default 0,
timer_on_mode char not null default 0,
power_off_mode char not null default 0,
rec_symbol char not null default 0,
pvr_record_type char not null default 0,
auto_timeshift char not null default 0,
auto_timeshift_time char not null default 0,
modulator_no char not null default 0,
rf_audio char not null default 0,
baud_rate char not null default 0,
pm_enable char not null default 0,
hsm_enable char not null default 0,
nds_box_key char not null default 0,
internal_port int not null default 0,
ytb_style char not null default 0,
movie_sub_language char not null default 0,
cur_play_prog_id int not null default 0,
installation_lock char not null default 0,
chmanager_lock char not null default 0,
system_lock char not null default 0,
network_lock char not null default 0,
record_driver varchar(6) default 'sda',
power_save_enable char not null default 0,
cur_play_radio_prog_id int not null default 0,
volumn_media int not null default 50,
keyboard_language char not null default 0,
audio_type char not null default 0,
time_sync char not null default 1,
dvbstatusinfo_display char not null default 0,
subtitle_on char not null default 0,
livebuffersize char not null default 0,
RecordIcon_time char not null default 1,
snk_info int not null default 0,
snk_enable char not null default 0,
dlna_enable char not null default 0,
xtimeshift char not null default 0,
timeshift_rec_save char not null default 0,
timeshift_save char not null default 0,
dvb_fta_search char not null default 0,
dvb_qam_mode char not null default 0,
dvb_auto_search_sym_select
char not null default 0,
dvb_auto_search_qam_select char not null default 0,
screen_area_xpos int not null default 0,
screen_area_ypos int not null default 0,
screen_area_width int not null default 1280,
screen_area_height int not null default 720,
tv_ratio char not null default 0,
osd_animation char not null default 0,
auto_check_update char not null default 4,
nu_enable char not null default 1,
user_guide char not null default 1,
font_size char not null default 1,
lcn char not null default 0,
hdmi_audio int not null default 0,
ad_on char not null default 0
);
CREATE TABLE subtitle_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
prog_id int NOT NULL default 0,
sub_pid int NOT NULL default 0,
language char unsigned NOT NULL default 0,
type char unsigned NOT NULL default 0,
composition_page_id int NOT NULL default 0,
ancillary_page_id int NOT NULL default 0
);
CREATE TABLE cable_transponder_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
ts_id int NOT NULL default 0,
on_id int NOT NULL default 0,
freq int NOT NULL default 0,
sym_rate int NOT NULL default 0,
qam int NOT NULL default 0,
disp_order int NOT NULL default 0,
tuner_index int NOT NULL default 0
);
CREATE TABLE terrestrial_transponder_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
ts_id int NOT NULL default 0,
on_id int NOT NULL default 0,
freq int NOT NULL default 0,
mux int NOT NULL default 0,
mode int NOT NULL default 0,
guard int NOT NULL default 0,
band_width int NOT NULL default 0,
disp_order int NOT NULL default 0,
tuner_index int NOT NULL default 0
);
CREATE TABLE fav_name_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name_lan_code char unsigned NOT NULL default 0,
fav_name varchar(32) NOT NULL default ''
);
CREATE TABLE timer_info_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
prog_id int NOT NULL default 0,
disp_order int NOT NULL default 0,
channel_name varchar(64) NOT NULL default '',
iStartYear int not null default 0,
iEndYear int not null default 0,
ucStartMonth char not null default 0,
ucEndMonth char not null default 0,
ucStartDay char not null default 0,
ucEndDay char not null default 0,
ucStartHour char not null default 0,
ucEndHour char not null default 0,
ucStartMin char not null default 0,
ucEndMin char not null default 0,
ucTimerRepeat char not null default 0,
ucTimerType char not null default 0,
ucPowerOff char not null default 0,
ucActive char not null default 0
);
CREATE TABLE fav_prog_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
prog_id int NOT NULL default 0,
fav_group_id int NOT NULL default 0,
disp_order int NOT NULL default 0,
tv_type char unsigned NOT NULL default 0
);
CREATE TABLE tp_network_name_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
tp_id int NOT NULL default -1,
tp_type int NOT NULL default 0,
name_lan_code int NOT NULL default 0,
name varchar(64) NOT NULL default ''
);
CREATE TABLE program_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
tp_id int NOT NULL default 0,
tp_type char NOT NULL default 0,
service_id int NOT NULL default 0,
network_name_id int NOT NULL default 0,
ecm_index char unsigned NOT NULL default 0,
lcn_no int NOT NULL default -1, name varchar(64) NOT NULL default '',
name_lan_code char unsigned NOT NULL default 0,
audio_selected char unsigned NOT NULL default 255,
sub_selected char unsigned NOT NULL default 255,
fav char unsigned NOT NULL default 0,
vid_pid int NOT NULL default 0,
pcr_pid int NOT NULL default 0,
pmt_pid int NOT NULL default 0,
pvt_pid int NOT NULL default 0,
vid_type char unsigned NOT NULL default 0,
tv_type char unsigned NOT NULL default 0,
other_type int NOT NULL default 0,
lock char unsigned NOT NULL default 0,
skip char unsigned NOT NULL default 0,
hide char unsigned NOT NULL default 0,
raps_disp_no int NOT NULL default 0,
raps_uni_no int NOT NULL default 0,
raps_genre int NOT NULL default 0,
disp_order int NOT NULL default 0,
stream_id int NOT NULL default 0,
prog_no int NOT NULL default 0,
backup_lcn_no int NOT NULL default -1,
bat_lcn_no int NOT NULL default -1,
service_type int NOT NULL default 0,
plpid int NOT NULL default 0
);