2014-10-10 2 views
0

전화 갭 기반 앱에 오프라인 성경을 통합하는 방법에 대한 아이디어가 있습니까? 장래에 장과 장의 북마크가 필요할 수 있습니다. 어떻게해야할까요? 로컬 json 파일이있을 수 있습니까? 하지만 이해할 수있는 아들을 찾지 못했습니다. KJV 성경을 찾고 있습니다. 또한 json 접근 방식을 북 마킹을 준수하도록 확장 할 수있는 방법을 모릅니다. 이견있는 사람?phonegap 앱에 오프라인 성경을 통합 하시겠습니까?

답변

2

전체 텍스트는 ~4MB입니다. 즉, 앱 실행시 전체 텍스트를 메모리에로드하는 것이 문제가되지 않아야합니다. - 그리고, JSON은 북마크에 대한 괜찮을 것 때문에 성경이 구조화 된 방법, 해시/배열 조회를 중첩 한 간단한 문제이다 :

var bible = { 
    genesis: [ 
     [ // first chapter 
      "In the beginning God created the heaven and the earth.", 
      "And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.", 
      ... 
     ], 
     [ // second chapter 
      "Thus the heavens and the earth were finished, and all the host of them.", 
      "And on the seventh day God ended his work which he had made; and he rested on the seventh day from all his work which he had made.", 
      ... 
     ], 
     ... 
    ], 
    exodus: [ 
     [ // first chapter 
      "Now these are the names of the children of Israel, which came into Egypt; every man and his household came with Jacob.", 
      ... 
     ], 
     ... 
    ], 
    ... 
}; 

모든 구절이를 사용하여보고 매우 빠른해야 구조 : 책을 가져 오려면 해시지도 조회이고, 장과 절은 배열 오프셋입니다.