SurveySparrow’s Mobile SDK lets you embed your surveys in your native Android apps. With today's mobile-driven population, gauging your customers for feedback from your mobile application is a surefire way to increase survey response rates, and gain the insights you need.
For instance, let's say you own an app for movie streaming, and you want to provide a more personalized experience and viewing recommendations to your viewers. To understand your viewers' likes and dislikes, you can ask them to rate a movie/documentary after they have finished watching it. By doing so, you can understand each viewer's preferences and interests, which can further help you in providing personalized movie recommendations.
By using SurveySparrow’s Mobile SDK, you can trigger a survey in your app using just a few lines of code, and analyze all the results in SurveySparrow's reporting module.
Let’s see how it works:
1. Create a movie review survey and include a Rating question. Navigate to Share.
2. Select Mobile SDK from the list of sharing channels.
3. Copy the token.
4. Now, let’s move on to the coding part:
Add SurveySparrow’s Android SDK to your app
Add the following line of code to the dependencies section of the app modules build.gradle file.
The SDK uses the internet to fetch surveys and submit responses to SurveySparrow. Add internet permissions in your AndroidManifest.xml file.
Create and show a survey(using Kotlin)
You can trigger a survey anywhere from your application at any time.
1. Create a survey.
2. Configure the SurveySparrow object.
3. Start the movie review survey.
RATE_MOVIE_REQUEST is an integer constant that is passed to identify the request. The ‘startSurveyForResult’ function triggers an inbuilt ‘startActivityResult’ and it can be called multiple times so that the constant can be used to identify the result in the ‘onActivityResult’ handler.
4. Handle survey responses.
This code block will be executed once the survey has been submitted or left incomplete. Once the survey is completed, and the rating given is 4 and above, respondents will be directed to a recommendations page. If the rating given is below 4, respondents will be redirected to the home page of the app.
If a respondent leaves the survey incomplete, a ‘Review survey not completed!’ message will be displayed on the console.
The developer can parse the responses and customize the behavior however they want.
To offer more personalization, the movie name can be passed as data from your app to your survey by using Custom Variables.
1. Click on the Global Variables icon on the left-sidebar on your survey, and create a variable called ‘movieName’.
2. Use this variable in your Rating question by clicking the dollar sign($) next to the question.
3. Now, use the addCustomParam method in your survey object to share values from your app to the survey.
You can style your survey to match the theme of your app by using Custom CSS. Paste the following code in the Advanced Editor. This will hide the bottom navigator, progress button, and password warning message in the survey.
You can further customize your survey by removing the SurveySparrow branding and by adding your custom logo.
You can find the full code of the Movie App here. For the full SDK documentation, please visit https://github.com/surveysparrow/surveysparrow-android-sdk
Please reach out to us if you have any questions. We are just a chat away!