Android
Last updated
Last updated
The Blitzllama Android SDK enables you to deliver in-product surveys directly inside your Android app. By integrating the SDK, you can collect targeted user feedback at critical moments in the user journey.
Key Features:
Quickly embed surveys via triggers you define in your app.
Identify and track users to ensure they don’t receive duplicate surveys unnecessarily.
Personalize surveys with user attributes and event properties (optional).
Localize surveys by setting different languages (optional).
Requirements:
Android 5.0 (API level 21) and above.
Java 8 compatibility (source and target).
Access to the Blitzllama dashboard (to retrieve your API key and manage triggers).
Obtain Your API Key:
Log in to the Blitzllama dashboard, navigate to Connections Tab, click Android, and find your API_KEY
.
Confirm Minimum SDK:
The SDK officially supports API level 21 and above. If your minSdk
is below 21, override the library in your AndroidManifest
:
Add the SDK to your app/build.gradle
and enable Java 8 (if not already):
We recommend using AppCompatActivity while using the SDK, otherwise the surveys won't show up HomeActivity extends AppCompatActivity{ }
Declare your Blitzllama API key:
Create or update your Application
class and extend BlitzLlamaSDK
:
NOTE: If you are registering the activity lifecycle in your application class, please make sure to call the SDK's init function below that.
Ensure you create a user with a unique ID before triggering surveys:
Add a trigger event to display surveys:
You’re now ready to collect targeted user feedback with Blitzllama's in-app surveys! 🚀 Read further to check other capabilities of Blitzllama and customize to your requirement.
Triggers are events in your app (e.g., button presses, screen loads) that prompt a survey if configured in the Blitzllama dashboard.
You can attach properties to a trigger event to provide additional context, such as screen names or user actions. These properties help refine your targeting.
Event schemas can be changed on the dashboard. You can use these properties to more filter users in the survey, as shown in the below screenshot.
Why Use Trigger Properties?
Filter users more precisely in the Blitzllama dashboard.
Understand user context when surveys are triggered.
You can also use backend events to launch in-app surveys. Check out https://documentation.blitzllama.com/connections/backend-trigger for more details.
Attributes help you segment and target specific user groups (e.g., plan type, user role). Allowed data_type
values are "string", "number", "date", "boolean".
Set User Email or Name:
To display surveys in the user's preferred language, set the survey language using an ISO 639-1 code (e.g., "en"
for English, "es"
for Spanish).
Why Set Survey Language?
Improve user experience by displaying surveys in the user's native language.
Supports better localization for global apps.
When a user logs out, call the logout method to clear their session and ensure subsequent events are not tied to the previous user’s data.
Why Logout?
Prevents mixing user data between sessions.
Ensures a clean state when switching users.
Receive a callback when a user completes a survey. This can be useful for analytics or triggering follow-up actions.
Example:
Every release we extensively test our SDK in multiple sample apps across devices and Android versions for crashes and performance issues. The performance impact is negligible and below are the stats for the latest SDK version.
Load times: All calls are async and hence does not impact app or screen load times.
App size: Blitzllama SDK AAR size is 150kb and it's size impact on an Android app is about 200kb.
CPU usage: A negligible increase of 1-5% CPU usage only when the micro survey is on-screen.
Survey not showing up?
Ensure createUser
is called before triggerEvent
.
Check that the event name matches exactly what’s configured in the Blitzllama dashboard.
Survey not showing up on the home screen or the first app page?
This might be a race condition, please pass a callback function as the second argument to createUser
function.
Switching users?
Call BlitzLlamaSDK.logout()
before creating a new user to avoid mixing sessions.
How to create triggers? There are two methods to create a trigger:
1. Add new trigger_name in your app and it will automatically be created if it doesn't exist and then be available for selection in the dashboard.
2.: To add a trigger into your app, first create a trigger on the Blitzllama dashboard with a trigger_name, then use the same trigger_name in the following function.
Make sure to create a user before triggering a survey.
Need more help?
Reach out over the support chat or email tech@blitzllama.com.
Start with adding 5 triggers for the most critical user actions in the app.
Create your first survey on the Blitzllama dashboard.
Customize the UI/UX of the survey on the Blitzllama dashboard.