µSurveys is an application for showing micro-suveys embedded in your own application. You can learn more and setup an account at https://musurveys.com
Add the dependency to gradle:
dependencies {
// ...
// µSurveys library
implementation "com.musurveys:musurveys-android-sdk:<latest-release>"
}
Configurations in your Application class:
@Override
public void onCreate() {
super.onCreate();
// Sign up at musurveys.com, to get an API key.
UserSneak.get()
.configureUserSneakApiKey(USER_SNEAK_API_KEY)
// See docs.usersneak.com to learn how to setup your sheet.
.configureSheetsId(SHEET_ID)
// Set the minimum amount of time that must pass before the user is shown another survey.
// See docs.userneak.com to learn more.
.configureResurveyWindowMillis(TimeUnit.SECONDS.toMillis(5));
}
Track and show surveys like so:
ActivityResultLauncher<Intent> muSurveysLauncher =
registerForActivityResult(
new StartActivityForResult(),
result -> {
// TODO: Survey complete, update the UI.
});
StatusCallback callback =
status -> {
switch (status) {
case NO_SURVEY:
case SURVEY_MALFORMED:
// TODO: Handle no survey present
break;
case AVAILABLE:
MuSurveys.get().showSurvey(requireActivity(), eventName, muSurveysLauncher);
break;
}
};
MuSurveys.get().track(eventName, callback);
- clone the project
- setup pre-commit
- Install Android Studio (check gradle properties file, but probably the latest canary version)
- import into AS
- Press Run
- See scripts/README
P0:
- Implement some error and stacktrace reporting
P1:
- Make the surveys look prettier
- Upload demo app to the play store