Android SDK
Runtime Application Self-Protection for Android. Detects threats continuously with zero impact on app performance.
1
Add the SDK
Place VeilSDK.aar in android/app/libs/ and add to your build.gradle:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.aar'])
}2
Initialize
Call once in your Application.onCreate() or main Activity. Your credentials are available in the Veil dashboard.
VeilSDK.initializeSDK(
context = this,
clientId = "your-client-id",
appId = "your-app-id",
appName = "My App",
packageName = packageName,
apiKey = "td_live_...",
policy = ThreatPolicy.WARN_ONLY,
activity = this,
) { response, error ->
if (response != null && !response.isSafe) {
// threat detected — response.riskLevel, response.threatCodes
}
}3
Choose a policy
Control how the SDK reacts when threats are detected.
| Policy | Behaviour |
|---|---|
| SILENT | Detect silently — no UI shown |
| WARN_ONLY | Show dismissible warning (default) |
| BLOCK_ON_HIGH | Block app on high severity threats |
| BLOCK_ON_CRITICAL | Block app on critical threats only |
Need full API documentation?
Complete reference, threat coverage, and compliance guides are available after onboarding.