我是Android应用程序开发的新手,现在可以创建一些活动并在它们之间导航。
现在我想在我的应用程序中插入完整的BIBLE。
但是,再次编写所有BIBLE几乎是不可能的,所以有人可以帮我解决这个问题。
提前致谢。
邮件ID:kiran121296
答案 0 :(得分:1)
我还不能发表评论,因为我的声誉还不够高,但我不得不为一堂课实施一次拼写检查,我们不得不使用一个500,000字的词典,它必须拼写检查电影剧本和圣经詹姆斯版的圣经。
我所做的是(假设你在Windows上)找到一本圣经pdf或在线点击ctr + A来选择它然后点击ctr + C复制它并将其粘贴到文本文档中。还有像http://www.sacred-texts.com/bib/osrc/这样的地方有文本文件形式的圣经。
现在,只要实现它,你可以在你的values文件夹中创建一个新的xml文件,然后在其中粘贴整个文本。如果您需要进一步澄清实施部分,请告诉我
要“导入”大量文本,您可以进入res / values文件夹然后(如果您使用的是android studio)右键单击values文件夹并选择new-> xml-> values xml文件。将它命名为bible_text或类似的东西。只需确保名称不包含任何空格。并将这行代码放在
中<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="my_text">
My String here
</string>
</resources>
然后将其粘贴在那里。 这是一个只有一小部分的例子
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="my_text">
Psalm 147
{147:1} Praise ye the LORD: for [it is] good to sing praises unto our
God; for [it is] pleasant; [and] praise is comely.
{147:2} The LORD doth build up Jerusalem: he gathereth together the
outcasts of Israel.
{147:3} He healeth the broken in heart, and bindeth up their wounds.
{147:4} He telleth the number of the stars; he calleth them all by
[their] names.
{147:5} Great [is] our Lord, and of great power: his understanding [is]
infinite.
{147:6} The LORD lifteth up the meek: he casteth the wicked down to the
ground.
{147:7} Sing unto the LORD with thanksgiving; sing praise upon the harp
unto our God:
{147:8} Who covereth the heaven with clouds, who prepareth rain for the
earth, who maketh grass to grow upon the mountains.
{147:9} He giveth to the beast his food, [and] to the young ravens
which cry.
{147:10} He delighteth not in the strength of the horse: he taketh not
pleasure in the legs of a man.
{147:11} The LORD taketh pleasure in them that fear him, in those that
hope in his mercy.
{147:12} Praise the LORD, O Jerusalem; praise thy God, O Zion.
{147:13} For he hath strengthened the bars of thy gates; he hath
blessed thy children within thee.
{147:14} He maketh peace [in] thy borders, [and] filleth thee with the
finest of the wheat.
{147:15} He sendeth forth his commandment [upon] earth: his word
runneth very swiftly.
{147:16} He giveth snow like wool: he scattereth the hoar frost like
ashes.
{147:17} He casteth forth his ice like morsels: who can stand before
his cold?
{147:18} He sendeth out his word, and melteth them: he causeth his wind
to blow, [and] the waters flow.
{147:19} He sheweth his word unto Jacob, his statutes and his judgments
unto Israel.
{147:20} He hath not dealt so with any nation: and [as for his]
judgments, they have not known them. Praise ye the LORD.
</string>
</resources>
现在你要使用文本所要做的就是引用你给它的名字
以下是如何在xml中引用它的示例。其中my_text是文本的名称
android:text="@string/my_text"
或者在java
中getApplicationContext().getResources().getString(R.string.my_text);