Skip to main content

Android Quickstart

Scan your Kotlin codebase, generate type-safe event sealed classes, and wire CI so bad analytics never reach the Play Store. About 10 minutes.

Create a workspace

Sign in at https://app.ordaze.com. Create a workspace for your Android app and name it after the product (e.g. MyApp Android). New signups get 14 days of Pro access automatically, no card required.

Define your first events

In the sidebar, go to Events → Add Event. Define the events your Android app fires today. Snake-case names travel well between SDKs (purchase_completed, checkout_started). Mark properties as required where the analyst will actually use them.

Once you have 3–5 events defined, go to Versions → Publish. The scanner needs at least one published version to check your code against.

Run the scanner locally

From the root of your Android project:
# Generate an API token at app.ordaze.com/settings/tokens, then:
export ORDAZE_TOKEN=YOUR_TOKEN

npx @ordaze/scanner scan \
  --platform android \
  --dir app/src/

The scanner walks every .kt and .java file, matches analytics calls against your tracking plan, and reports matched / unmatched / missing events. Nothing is added to Gradle. Nothing runs at runtime.

Generate the typed Kotlin wrapper

In the Ordaze dashboard go to Code Generation, pick the Kotlin default template, and download. Drop the generated Analytics.kt into your Android project for a sealed-class namespace on every event:
import com.yourapp.analytics.Analytics
import com.yourapp.analytics.Currency

Analytics.PurchaseCompleted(
    amount = 9.99,
    currency = Currency.USD
).track()
// Compiler enforces required properties + enum values.

Wire the GitHub Action

Drop this workflow into .github/workflows/analytics.yml so every PR blocks merges when coverage drops:
name: Analytics Coverage
on: [pull_request]

jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: ordaze/ordaze-scanner@v1
        with:
          token: ${{ secrets.ORDAZE_TOKEN }}
          platform: android
          strict: true
          min-coverage: 80

Store your token as ORDAZE_TOKEN in Settings → Secrets and variables → Actions. With strict: true + min-coverage: 80, any PR that drops coverage below 80% or adds an unknown event will fail the check.