Spindl
  • 👋Overview
    • Introduction
    • Attribution
    • Privacy
  • Your Spindl app setup
    • Managing team members
  • 🪄Features
    • 📈Onchain Attribution
      • 📉Plotting attribution
    • 📊Web3-native Analytics
      • Chart Builder
      • Event Selection and Filtering
      • Line Chart
      • Funnel
      • Cohort Retention
      • Sankey Diagram
      • Big Numbers
      • Pies and Donuts
    • 🧍‍♂️Audiences
      • Creating an audience
    • 🔗Short Links
      • 🖇️Custom Domains
    • 🤝Referrals
      • Management and reporting
      • ⏩Quick Start
      • ⛓️Technical Details
  • ⚙️Techncial
    • ⏩Start Here
    • Google GTM Guide
    • Javascript SDK / HTML Script Guide
      • ➡️Install
      • ➡️Wallet Connects
      • ➡️Page Views
      • ➡️Custom Events
      • ✅Verify That Events Are Sent Correctly
      • React, Next.js & Html Examples
      • Setup a Reverse Proxy
        • Using Next.js
        • Using Cloudflare Workers
        • Netlify
      • ➡️Referrals
      • Default vs Lite SDK Versions
      • Security
    • API
      • ➡️Short Links
      • ➡️Custom Events API
      • Data Exports
    • Android SDK
    • iOS (Swift) SDK
    • On-Chain
      • ➡️Rewards
  • Contact Spindl
  • Ads
    • ⏩Start Here
    • 📢Creative Specifications
      • Web Banner Ads
      • Discord Embeds
Powered by GitBook
On this page
  • Install Using Android Studio
  • Initialize SDK
  • Track Events
  • Identify Users
  1. Techncial

Android SDK

Install Using Android Studio

  1. Open the Project Structure dialog (File > Project Structure...).

  2. Choose Dependencies from the left pane, then the main module (e.g. app).

  3. Click the + button in the Declared Dependencies pane, and choose 1 Library Dependency from the popup menu to open the Add Library Dependency dialog.

  4. In the Add Library Dependency dialog, type xyz.spindl under Step 1 and press the Search button.

  5. Choose the xyz.spindl | sdk result from the results table, and the highest version available.

  6. Make sure implementation is selected under Step 2, and press OK.

Initialize SDK

Setup a Spindl instance, e.g. in MainActivity:

class MainActivity : ComponentActivity() {
    private lateinit var spindl: Spindl

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        val apiKey = getString(R.string.spindlApiKey)
        lifecycleScope.launch {
            spindl = Spindl(context = applicationContext, lifecycleOwner = this@MainActivity)
            spindl.initialize(apiKey = apiKey)
        }
    ...

Track Events

Track events with the track method:

  • name is required

  • properties are optional

val properties = JsonObject()
properties.addProperty("prop1Key", "prop1Value")

spindl.track("eventName", properties)

Identify Users

Once customers enter their customer ID (such as email) and/or wallet information (e.g., after logging in), connect that to the analytics by calling the identify method:

spindl.identify(walletAddress = wallet, customerUserId = userId)
PreviousData ExportsNextiOS (Swift) SDK

Last updated 8 months ago

⚙️