Creating android app Database with big amount of data

后端 未结 4 423
轮回少年
轮回少年 2020-12-17 01:16

The database of my application need to be filled with a lot of data, so during onCreate(), it\'s not only some create table sql instructions, there is a lot of

4条回答
  •  既然无缘
    2020-12-17 02:10

    The SQL file solution seems perfect, it's just that you need to make sure that the file is saved in utf8 encoding otherwise all the accentuated characters will be lost. If you don't want to change the file's encoding then you need to pass an extra argument to new String(bytes, charset) defining the file's encoding.

    Do prefer to use file resources instead of static final String to avoid having all those unnecessary bytes loaded into memory. In mobile phones you want to save all memory possible!

提交回复
热议问题