Skip to content

ShipBook/ShipBookSDK-Android

Repository files navigation

ShipBook SDK for Android

Maven Central

Shipbook SDK for Android applications. Capture logs, errors, and exceptions from your Android apps and view them in the Shipbook console. Learn more at shipbook.io.

Installation

Add to your build.gradle:

dependencies {
    implementation 'io.shipbook:shipbooksdk:1.+'
}

Quick Start

import io.shipbook.shipbooksdk.ShipBook
import io.shipbook.shipbooksdk.Log

// Initialize Shipbook (do this once in Application.onCreate)
ShipBook.start(application, "YOUR_APP_ID", "YOUR_APP_KEY")

// Get a logger for your class/component
val log = ShipBook.getLogger("MainActivity")

// Log messages at different severity levels
log.v("Detailed trace information")
log.d("Debug information")
log.i("General information")
log.w("Warning message")
log.e("Error message")

// Log with an exception
try {
    throw IllegalStateException("Something failed")
} catch (e: Exception) {
    log.e("Operation failed", e)
}

Features

  • Remote Logging - View all your app logs in the Shipbook console
  • Error Tracking - Automatically captures uncaught exceptions
  • Session Tracking - Group logs by user session
  • Offline Support - Logs are queued and sent when connectivity is restored
  • Dynamic Configuration - Change log levels remotely without redeploying
  • User Identification - Associate logs with specific users

Configuration

Enable Inner Logging (Debug Mode)

ShipBook.enableInnerLog(true)

Register User

ShipBook.registerUser(
    "user-123",
    userName = "johndoe",
    fullName = "John Doe",
    email = "john@example.com",
    phoneNumber = "+1234567890",
    additionalInfo = mapOf("role" to "admin")
)

Logout

ShipBook.logout()

Screen Tracking

ShipBook.screen("HomePage")

Static Log Methods

You can also use static methods without creating a logger instance:

Log.e("MyTag", "Something went wrong")
Log.w("MyTag", "This is a warning")
Log.i("MyTag", "General info")
Log.d("MyTag", "Debug info")
Log.v("MyTag", "Trace info")

Getting Your App ID and Key

  1. Sign up at shipbook.io
  2. Create a new application in the console
  3. Copy your App ID and App Key from the application settings

For full setup instructions, see the Android documentation.

Links

Author

Elisha Sterngold (ShipBook Ltd.)

License

ShipBook SDK is available under the MIT license. See the LICENSE file for more info.

About

A logging system for Android

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors