Open a verse from your app
Your Android app can open the Hebrew/Greek Interlinear Bible, in English or Spanish, directly on a verse, so your readers jump straight to its interlinear text. Everything happens on the device, so it works offline.
This is a stable contract: the link format, extra names and numbering below will not change.
The apps
| App | Package |
|---|---|
| Hebrew/Greek Interlinear Bible (English) | com.hagiostech.greekinterlinearbible |
| Biblia Interlineal Hebreo/Griego (Spanish) | com.hagiostech.greekinterlinearbible.spanish |
Both apps accept exactly the same link and extras. See choosing English or Spanish.
Option 1: link (recommended)
hgib://verse/{book}/{chapter}/{verse}
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("hgib://verse/43/3/16"));
try {
startActivity(intent);
} catch (ActivityNotFoundException e) {
// Neither app is installed: offer the Google Play listing instead.
}
This works whether the app is closed, in the background, or showing another of its
screens. From an Activity, no extra flags are needed. From a Service or other
non-Activity context, add Intent.FLAG_ACTIVITY_NEW_TASK, as with any launch.
Option 2: extras on the launch intent
Pass book, chapter and verse as int extras on the app's launch intent:
Intent intent = getPackageManager()
.getLaunchIntentForPackage("com.hagiostech.greekinterlinearbible");
if (intent != null) {
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("book", 43);
intent.putExtra("chapter", 3);
intent.putExtra("verse", 16);
startActivity(intent);
}
- The two flags are required. Without them, if the app is already running, Android only brings it to the front and the verse is ignored.
- The values must be ints. A value sent as a String (
"43") is treated as missing.
Android 11+ package visibility
If your app targets Android 11 (API 30) or later, getLaunchIntentForPackage
returns null unless you declare the packages in your manifest:
<queries>
<package android:name="com.hagiostech.greekinterlinearbible" />
<package android:name="com.hagiostech.greekinterlinearbible.spanish" />
</queries>
The link in Option 1 does not need this entry.
Choosing English or Spanish
-
Link: if the reader has only one of the apps, it opens. If they have
both, Android asks which one to use. To always open a specific one, set its package:
With a package set and that app not installed,intent.setPackage("com.hagiostech.greekinterlinearbible"); // English intent.setPackage("com.hagiostech.greekinterlinearbible.spanish"); // SpanishstartActivitythrowsActivityNotFoundException, so you can fall back to the other app or to Google Play. -
Extras: the package you pass to
getLaunchIntentForPackagechooses the app. It returnsnullwhen that app isn't installed.
Numbering
- Book: 1–66 in the order of the Protestant canon (listed below).
- Chapter and verse: standard English (KJV) versification, the same in both apps. For example, Malachi has 4 chapters, Joel has 3, and Psalm titles are not counted as verses.
- A verse that doesn't exist (book 70, John 99:1, a missing part) opens the app on the reader's last verse with a short "Verse not found" message. It never crashes.
Old Testament
- 1Genesis
- 2Exodus
- 3Leviticus
- 4Numbers
- 5Deuteronomy
- 6Joshua
- 7Judges
- 8Ruth
- 91 Samuel
- 102 Samuel
- 111 Kings
- 122 Kings
- 131 Chronicles
- 142 Chronicles
- 15Ezra
- 16Nehemiah
- 17Esther
- 18Job
- 19Psalms
- 20Proverbs
- 21Ecclesiastes
- 22Song of Solomon
- 23Isaiah
- 24Jeremiah
- 25Lamentations
- 26Ezekiel
- 27Daniel
- 28Hosea
- 29Joel
- 30Amos
- 31Obadiah
- 32Jonah
- 33Micah
- 34Nahum
- 35Habakkuk
- 36Zephaniah
- 37Haggai
- 38Zechariah
- 39Malachi
New Testament
- 40Matthew
- 41Mark
- 42Luke
- 43John
- 44Acts
- 45Romans
- 461 Corinthians
- 472 Corinthians
- 48Galatians
- 49Ephesians
- 50Philippians
- 51Colossians
- 521 Thessalonians
- 532 Thessalonians
- 541 Timothy
- 552 Timothy
- 56Titus
- 57Philemon
- 58Hebrews
- 59James
- 601 Peter
- 612 Peter
- 621 John
- 632 John
- 643 John
- 65Jude
- 66Revelation
Questions
Write to hagiostech@gmail.com. We'd be glad to hear which app you're linking from.