Installation is very straight forward; just add .jar files inside "bin" directory as libraries to your project and you are all set. Below are some examples of usage:
Mushaf:
- Set Mushaf (one of MUSHAF_SIMPLIFIED, MUSHAF_UTHMANI, MUSHAF_ENGLISH_LITERAL)
Quran.setMushaf(Quran.MUSHAF_SIMPLIFIED);
- Download it (or skip this step and have it downloaded automatically when required)
QuranicTextManager.updateText(Quran.MUSHAF_SIMPLIFIED);
- Optional: Load Mushaf into memory for faster access (skip this step on Android to preserve memory)
Quran.load();
- Get verse/ayah
Quran.getVerseContent(0);
Translations and other texts:
- Check required resources
boolean b = QuranicTextManager.init();
- Get texts list (type, minimum completion percent, language code)
List<QuranicTextIdentifier> qti = QuranicTextManager.getTextsOnServer(QuranicTextType.TRANSLATION_TEXT, 100, "en");
or get a list of locally available (already downloaded) texts
List<QuranicTextIdentifier> qti = QuranicTextManager.getLocalTexts();
- Add returned texts to the provided ordered list
for (int i = 0; i < qti.size(); i++)
QuranicTextList.addText(qti.get(i).getID());
- Get a text
QuranicText qtxt = QuranicTextList.getTextByOrder(0);
- Download the text and make its content available offline
QuranicTextManager.updateText(qtxt.getIdentifier().getID());
- Get text content
qtxt.getVerseContent(Quran.getVerse(Quran.SECTION_COUNT, 1));
Bookmarks:
QuranicBookmarkList qbl = new QuranicBookmarkList(); //create a bookmark list
qbl.addBookmark(new QuranicBookmark(Quran.getRandomVerse(), "some random verse")); //add a bookmark to the list
QuranicBookmarkManager.createNewFileAndWrite(new File("random bookmarks list"), qbl.getBookmarks()); //save list to file
QuranicBookmark[] readBookmarks = QuranicBookmarkManager.getBookmarks(new File("another bookmarks list")); //read bookmarks from file
qbl.clearBookmarks();
qbl.addBookmarks(readBookmarks); //add read bookmarks to the list
qbl.getBookmark(0); //get first bookmark
Required permissions on Android:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
You can also use this library to find similar verses to a particular one, find section/surah names and meanings, check for prostration verses etc. Check "doc" folder for a complete methods overview.