2017-07-13 6 views
0

私は賛美歌のアプリケーションを作成しています。これには500賛美歌のようなものが含まれています。だから、この500の賛美歌詞をstring.xmlに保存しても大丈夫ですか?または、私のアプリがあまりにも多くのメモリスペースを必要としないため、私はデータベースに保存する必要があります。ありがとうsting.xmlに大きな文字列を保存しても問題ありません

+0

試しましたか?もしそうなら、何が起こったのですか? – tadman

+0

私はまだそれを構築しています –

+0

xmlとデータベースの両方がファイルです。違いはありません。あなたのデータは構造体がデータベースを使用しない場合 – Mohsen

答えて

0

私はそれをJsonファイルに入れて、最初のインストール時に読み込み中のanimatinを使ってスプラッシュ画面を表示すると、ロード中にjsonファイルを解析して領域に保存する方が良いでしょう

[ 
    { 
    "Hymn1": { 
     "title": "title 1", 
     "singer": "singer1", 
     "Lyrics": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum" 
    } 
    }, 
    { 
    "Hymn2": { 
     "title": "title 2", 
     "singer": "singer2", 
     "Lyrics": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum" 
    } 
    } 
] 

レルムのこのマニュアルを確認することができます:JSONファイルのデータベースの一例 https://realm.io/docs/java/latest/#json

0

あなたは.jsonファイル内のすべての情報を保存し、あなたのアプリでそのファイルを置くことができます。 ファイルの重さはそれほどありません。

関連する問題