The minimum Android version required is 21
. Also, the compile SDK version version for android is 31
(But you should generally compile with the latest version)
The SDK is available from the central Maven repo. Add it in your root settings.gradle.
dependencyResolutionManagement {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add a reference to the latest version of QuestionPro SDK in your app's build.gradle.
dependencies {
implementation 'com.github.surveyanalyticscorp:android-cx:1.2.8'
}
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Add the api key obtained from QuestionPro portal:
<meta-data android:name="cx_manifest_api_key"
android:value="your api key here"/>
<activity android:name="com.questionpro.cxlib.interaction.InteractionActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:configChanges="keyboardHidden"
android:windowSoftInputMode="adjustPan"/>
You have to initialize the SDK in the base Activity, For example:
TouchPoint touchPoint=new TouchPoint.Builder(Type.CUSTOMER_EXPERIENCE)
.build();
QuestionProCX.init(CurrentActivity.this, touchPoint);
(Here The Type.CUSTOMER_EXPERIENCE is to use the feedback survey from QuestionPro CX and
Type.SURVEY is to use the survey from QuestionPro.)
You can add touchpoint hook wherever you want to show the feedback screen. For example:
QuestionProCX.launchFeedbackSurvey(SURVEY_ID);
(Here the SURVEY_ID which is obtained from QuestionPro platform.)
TouchPoint touchPoint = new TouchPoint.Builder(Type.CUSTOMER_EXPERIENCE)
.email("respondent_email_id")
.firstName("respondent_name")
.lastName("respondent_last_name")
.showAsDialog(false)//Whether you want to feedback survey as a dialog on full screen.
.themeColor("#0000FF")
.transactionLanguage("English")
.build();