Skip to content

VerseWell/biblekit-kmp

Repository files navigation

BibleKit KMP

Kotlin Kotlin Multiplatform Maven Central Documentation codecov License

BibleKit KMP is a Kotlin Multiplatform library that provides Bible-related functionality for iOS, macOS, and Android platforms.

Features

  • 🔍 Powerful verse search functionality
  • 📚 Cross-platform Bible database access
  • 📱 Support for iOS, macOS, and Android
  • ⚡️ Built with Kotlin Multiplatform

Requirements

  • Android: minSdk 24+
  • iOS: 13.0+
  • macOS: 10.15+

Installation

Gradle (Android)

dependencies {
    implementation("com.aarkaystudio.biblekit:biblekit:0.2.1")
}

Swift Package Manager (iOS/macOS)

Add the following to your Package.swift file:

dependencies: [
    .package(url: "https://github.com/VerseWell/biblekit-kmp.git", from: "0.2.1")
]

Alternative: Native Swift Library

If you prefer using native Swift instead of Kotlin Multiplatform, we maintain a dedicated Swift library alongside this one:

  • BibleKit Swift - A native Swift library for iOS/macOS developers who want the most idiomatic Swift APIs and experience for Apple platforms

As a Swift developer first, I am actively maintaining both libraries. This KMP version allows me to explore cross-platform development potential while providing a solution for teams that need Android support. Both libraries provide the same core functionality, so choose the one that best fits your project's architecture and team preferences.

Usage

Important

Your app must include a file named bible.db in its bundle. This SQLite database file contains the Bible content and is required for the library to function. You can find:

You can replace the bible.db file with your preferred translation as long as it follows the same database schema.

Kotlin (Android)

// Copy bible.db from assets to app directory if it doesn't exist
val dbFile = File(applicationContext.filesDir, "bible.db")
if (!dbFile.exists()) {
    applicationContext.assets.open("bible.db").use { input ->
        FileOutputStream(dbFile).use { output ->
            input.copyTo(output)
        }
    }
}

// Initialize with the database file path
val provider = BibleProvider.create(
    dbFactory = BibleDatabaseFactory(context = applicationContext),
    filePath = dbFile.absolutePath
)

// Search
val results = provider.search(
    query = "love",
    verseIDs = null
)

Swift (iOS/macOS)

// Get the bible.db path from the app bundle
guard let dbPath = Bundle.main.path(forResource: "bible", ofType: "db") else {
    fatalError("bible.db not found in bundle")
}

// Initialize with the database file path
let provider = BibleProvider.companion.create(
    dbFactory: BibleDatabaseFactory(),
    filePath: dbPath
)

// Search
let results = try await provider.search(
    query: "love",
    verseIDs: nil
)

Documentation

For detailed API documentation, visit BibleKit KMP Documentation

Bible Translation

The example database included with BibleKit uses the World English Bible translation (Protestant, US English) with modifications.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

About

BibleKit KMP is a Kotlin Multiplatform library that provides Bible-related functionality for iOS, macOS, and Android platforms.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors