Android SDK
The Inhouse Android SDK provides comprehensive tracking and analytics capabilities for your native Android applications, including shortlink tracking, install attribution, and deep linking support.Installation
Gradle Dependencies
Add the SDK to yourapp/build.gradle:
Maven
Add the SDK to yourpom.xml:
Manual Installation
Download the AAR file and add it to your project:- Download the latest
client-sdk-distribution.zip - Unzip it in your
app/libs/directory - Add the following to your
app/build.gradle:
Quick Start
Basic Setup
Initialize the SDK in your application:Activity Integration
For proper deep link handling, extendBaseTrackingActivity or manually set the current activity:
Event Tracking
App Open Tracking
Track when users open your app:Session Tracking
Track user sessions:Shortlink Click Tracking
Track shortlink interactions:Custom Event Tracking
Track custom business events:Install Attribution
Install Referrer Tracking
The SDK automatically handles install attribution through Play Store referrers:Install from Shortlink
Track app installs attributed to shortlinks:Deep Linking
App Links Configuration
Configure app links in your Android manifest:Custom URL Schemes
Handle custom URL schemes:Deep Link Handling
The SDK automatically handles deep links when usingBaseTrackingActivity:
SDK Information
Device and Session Information
Access SDK-generated identifiers:Debug and Testing
For development and testing:Privacy and Compliance
Data Collection
The SDK collects the following data automatically:- Device Information: Device ID (generated), user agent, IP address
- Event Data: Timestamps, event types, shortlink URLs
- Install Attribution: Install referrer data from Play Store
- Session Data: Session IDs, app open/close events
User Consent
Implement user consent before initializing the SDK:Advanced Features
Network Configuration
The SDK uses OkHttp for network requests with the following defaults:- Timeout: 30 seconds connection timeout
- Retry: Up to 3 retry attempts
- HTTPS: All data transmitted over HTTPS
Error Handling
Handle SDK errors in your callback:Integration Examples
E-commerce Integration
Marketing Campaign Tracking
Best Practices
Event Naming
- Use Descriptive Names: Use clear, descriptive event names like
product_view,add_to_cart - Consistent Naming: Use snake_case for event names consistently
- Meaningful Categories: Group related events with prefixes (
user_action,ecommerce_event)
Data Management
- Minimal Data: Only include necessary data in additional properties
- Consistent Properties: Use consistent property names across events
- Valid Data Types: Ensure property values are strings, numbers, or booleans
Performance Optimization
- Async Tracking: All SDK methods are asynchronous by default
- Batch Processing: SDK automatically batches events for efficiency
- Network Optimization: SDK handles network retries and timeouts
Privacy and Security
- User Consent: Always respect user privacy preferences
- Data Minimization: Only collect data necessary for your use case
- Secure Transmission: SDK uses HTTPS for all data transmission
Troubleshooting
Common Issues
Events Not Sending- Verify project token and token ID are correct
- Check network connectivity
- Enable debug logging to see detailed logs
- Verify server URL configuration
- Check Android manifest configuration
- Verify app link domain verification
- Test deep links using ADB:
adb shell am start -W -a android.intent.action.VIEW -d "https://yourdomain.com/test"
- Ensure install referrer is properly configured
- Check Play Store install referrer setup
- Verify first install detection logic
Debug Commands
Next Steps
iOS SDK
Integrate with native iOS apps.
API Reference
Use the REST API for advanced integration.
Deep Linking
Set up deep linking for seamless navigation.
Analytics
Understand your analytics data.
Need help with the Android SDK? Check our API
documentation or contact
[email protected].