Launcher数据库总结

Launcher数据库总结

文章目录

  • Launcher数据库总结
    • 1、引言
    • 2、database.db中所有的表
    • 3、android_metadata表
    • 4、satellite_table表
    • 5、audio_table表
    • 6、satellite_transponder_table表
    • 7、box_info_table表
    • 8、subtitle_table表
    • 9、cable_transponder_table表
    • 10、terrestrial_transponder_table表
    • 11、fav_name_table表
    • 12、timer_info_table表
    • 13、fav_prog_table表
    • 14、tp_network_name_table表
    • 15、program_table表

1、引言

Launcher从第一套开发到现在已经过去了很多个年头,后续的Launcher也是和第一套Launcher使用的同一套逻辑,虽然不断的在开发新Launcher,但是逻辑代码部门缺很少改动。这也使得逻辑的代码较为混乱臃肿,其中数据库模块代码更加臃肿不利于后期开发维护。至此写篇总结,用于在后期重构过程中进行参考。

2、database.db中所有的表

database.db数据库中涉及的表比较多一共有13张表,下面详细列出所包含的表如下:

  • 1、android_metadata
  • 2、satellite_table
  • 3、audio_table
  • 4、satellite_transponder_table
  • 5、box_info_table
  • 6、subtitle_table
  • 7、cable_transponder_table
  • 8、terrestrial_transponder_table
  • 9、fav_name_table
  • 10、timer_info_table
  • 11、fav_prog_table
  • 12、tp_network_name_table
  • 13、program_table

3、android_metadata表

  • 建表SQL(字段数1)
    CREATE TABLE android_metadata (
    	locale TEXT
    );
    

4、satellite_table表

  • 建表SQL(字段数25)
    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
    );
    

5、audio_table表

  • 建表SQL(字段数9)
    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
    );
    

6、satellite_transponder_table表

  • 建表SQL(字段数16)
    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
    );
    

7、box_info_table表

  • 建表SQL(字段数113)
    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
    );
    

8、subtitle_table表

  • 建表SQL(字段数7)
    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
    );
    
    

9、cable_transponder_table表

  • 建表SQL(字段数8)
    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
    );
    

10、terrestrial_transponder_table表

  • 建表SQL(字段数10)
    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
     );
    

11、fav_name_table表

  • 建表SQL(字段数3)
    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 ''
    );
    

12、timer_info_table表

  • 建表SQL(字段数18)
    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
      );
    

13、fav_prog_table表

  • 建表SQL(字段数5)
    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
     );
    

14、tp_network_name_table表

  • 建表SQL(字段数5)
    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 ''
    );
    

15、program_table表

  • 建表SQL(字段数32)
    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
    );
    

你可能感兴趣的:(Android)