Quick Start
Install and configure the Grovs Android SDK in your app
Upgrading from 1.x? See the 3.0 upgrade guide.
Requirements
- Android 5.0 (API 21) or later
- Kotlin 1.8 or later, or Java 8 or later
- Your app's package name and SHA-256 signing fingerprint registered in the Grovs dashboard — see How to Get the Package Name and How to Get the SHA-256 Fingerprint
Installation
Add the Grovs dependency to your app-level build.gradle:
dependencies {
implementation("io.grovs:Grovs:3.0.0")
}The artifact is published on Maven Central.
Configuration
1. Initialize the SDK
Configure Grovs in your Application class:
import io.grovs.Grovs
import io.grovs.model.LogLevel
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
// Optional: verbose logging while integrating
Grovs.setDebug(LogLevel.INFO)
Grovs.configure(this, "your-api-key", useTestEnvironment = false)
// Optional: identify the user (after configure)
Grovs.identifier = "user_id_from_your_app"
Grovs.attributes = mapOf("name" to "John Doe", "plan" to "premium")
}
}Configuration options
configure has four overloads. Each longer one adds a parameter and requires every earlier one:
Grovs.configure(application, apiKey, useTestEnvironment, baseURL = null)
Grovs.configure(application, apiKey, useTestEnvironment, baseURL, autoTrackScreenViews)
Grovs.configure(application, apiKey, useTestEnvironment, baseURL, autoTrackScreenViews, clipboardDomains)
Grovs.configure(application, apiKey, useTestEnvironment, baseURL, autoTrackScreenViews, clipboardDomains, enabled)Only baseURL has a default. The shorter overloads behave as if autoTrackScreenViews = true, clipboardDomains = null, and enabled = true.
| Parameter | Default | Description |
|---|---|---|
application | — | Your Application instance. |
apiKey | — | Your project API key from the Grovs dashboard. |
useTestEnvironment | — | true targets your project's test environment (its own domain, links, and data); false targets production. Use true only in development builds. |
baseURL | Grovs cloud | Domain of a self-hosted backend, e.g. "https://sdk.example.com". The SDK appends the API path. |
autoTrackScreenViews | true | Track Activity and Fragment screen views automatically. See Events & Screen Tracking. |
clipboardDomains | none | Extra link hosts accepted by clipboard-assisted deferred deep linking. Grovs-owned hosts are always accepted. |
enabled | true | Whether the SDK may collect and send anything on this launch. Pass your stored consent value — it is not persisted. See Privacy & Consent. |
There are no defaults past baseURL, so to set a later parameter pass every earlier one, by name or by position:
Grovs.configure(
this,
"your-api-key",
useTestEnvironment = false,
baseURL = null,
autoTrackScreenViews = false,
clipboardDomains = listOf("links.yourdomain.com"),
enabled = hasConsent
)Calling configure again replaces the previous configuration. The shorter overloads reset enabled to true, so a setSDK(false) made before configure does not carry over — pass consent through configure instead.
2. Forward lifecycle events
In your launcher activity, forward onStart and onNewIntent to the SDK so it can resolve incoming links:
class MainActivity : AppCompatActivity() {
override fun onStart() {
super.onStart()
Grovs.onStart(this)
}
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
Grovs.onNewIntent(intent, this)
}
}3. Add intent filters
Add these intent filters to your launcher activity in AndroidManifest.xml:
<!-- Custom URL scheme -->
<intent-filter>
<data android:scheme="your_app_scheme" android:host="open" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<!-- App links (production) -->
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="your_app_host" />
</intent-filter>
<!-- App links (test) -->
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="your_app_test_host" />
</intent-filter>The SDK itself declares the INTERNET and ACCESS_NETWORK_STATE permissions; you do not need to add them.
Next steps
- Handle incoming deep links →
- Generate smart links →
- Track events and screens →
- Gate collection on user consent →
- Explore the Android example app →
See also
- How to Get the Package Name — find the application ID required when configuring your app in the Grovs dashboard
- How to Get the SHA-256 Fingerprint — obtain the debug and release fingerprints needed for App Links verification
- How to Add a New Intent Filter — configure intent filters for deep linking in more detail
- How to Add a Package with Gradle — step-by-step Gradle dependency setup
- Deep link not opening the app — fix links that open the browser instead of your app
- SDK configuration issues — resolve common setup and initialization problems