Skip to main content

Setup Android

Please not that our Android SDK is still in Beta.

Gradle

Installation

Add the following to settings.gradle.kts (project root).

These instructions apply for apps using .kts gradle files.

pluginManagement {
repositories {
maven {
url = uri("https://android-sdk.logdog.app")
}
}
}

dependencyResolutionManagement {
repositories {
maven {
url = uri("https://android-sdk.logdog.app")
}
}
}

Add the LogDog dependency to your app's build.gradle (module) file:

plugins {
id("com.modrena.logdog.plugin") version "1.0.X" // Dont forget to set the desired version
}

dependencies {
implementation("com.modrena.logdog:logdog-sdk:1.0.X") // Dont forget to set the desired version
}

API Key

  1. Create an account at client.logdog.app
  2. Copy your API key from the project settings

Initialize LogDog

Add the following code to your Application class:

import com.modrena.logdog.LogDog
import com.modrena.logdog.LogDogConfig

class YourApplication : Application() {
override fun onCreate() {
super.onCreate()
LogDog.initialize(this)
val config = LogDogConfig(apiKey = "YOUR_API_KEY", logs = true, network = true, events = true)
LogDog.start(config)
LogDog.i("LogDog","Hello from LogDog!")
}
}

Verification

To verify that LogDog is properly installed and configured:

  1. Place a log statement like LogDog.i("LogDog","Hello from LogDog!")
  2. Run your app
  3. Check the LogDog dashboard - you should see the log appear immediately

Available Methods

Setup and Configuration


// Set custom device name
LogDog.setCustomDeviceName(name = "Pixel 7 Test Device")

Logging

// Basic logging
LogDog.l("LogDog","Message")
LogDog.i("LogDog","Info message")
LogDog.w("LogDog","Warning message")
LogDog.e("LogDog","Error message")

Event Tracking

// Send custom event
LogDog.logEvent(
name = "button_tap",
category = "ui_interaction",
payload = mapOf(
"button_id" to "submit_button",
"screen" to "checkout"
)
)

Debug Options

// Enable/disable debug window in production builds; Is active by default
LogDog.setDebugShake(value = true)

// Get SDK version
LogDog.getVersion(): String

// Delete device ID
LogDog.deleteDeviceId()

Best Practices

  1. Initialize LogDog as early as possible in your app lifecycle
  2. Use appropriate log levels for different types of information
  3. Add relevant metadata to help with debugging
  4. Handle sensitive information appropriately
  5. Monitor network usage and adjust configuration if needed

Troubleshooting

If you're not seeing logs in the dashboard:

  1. Verify your API key is correct
  2. Check that LogDog.initialize() has been called
  3. Ensure you have network connectivity on desktop and your mobile devices
  4. Check if any logs are being filtered by your configuration

Next Steps

  • Configure LogDog for your specific needs
  • Set up network request mocking

Support

If you have questions send us an email via hello@logdog.app. We are happy to help!