Skip to main content
Skip table of contents

Adding New App Details (Android)

Upon installing SDK, you must add your app via the Dropthought mobile app.

Follow the below steps to add a new app:

  1. Navigate to your Profile on the Dropthought mobile app.

  2. Click on Manage Native SDK.

     

     

  3. Click on Manage Applications. The section will be empty if you do not have any apps added.

    If you have already added any apps earlier, they will be displayed on this screen.

     

  4. Click on Browse and upload an app icon.

     

  5. Enter the App Name and Version Name (optional).

     

  6. Click on Add new visibility.
    In the following screen, you will be prompted to enter the page name and element name that should redirect the user to the linked program.
    This information will help you to easily identify which element (widget, for instance) on your app is connected to a visibility ID. You can edit the page name and element name anytime.

  7. Once you add a page and element name for later reference, click on Add Visibility.
    This will give you a unique ID you must insert in the code snippet to be added to your app. This unique ID cannot be edited as it will be used to uniquely identify the element of your app where Dropthought will collect feedback.

 

Open Program

Use the following snippet to open the Dropthought survey based on an action performed by a user on your app.
Copy the visibility ID and paste it into the code snippet below, replacing YOUR_VISIBILITY_ID. 

Pre-requisite: Declare
Dropthought.openSurveyActivity(Activity activity, String visibilityId)

CODE
public class MainActivity extends AppCompatActivity {

    @Override

    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

        Dropthought.init(...)

        Button button = findViewById(R.id.btn_open_survey);

        button.setOnClickListener(new View.OnClickListener() {

            @Override

            public void onClick(View view) {

                // This is how you display a survey for the user to take

                // Remember: you must supply the activity (e.g. this)

+               Dropthought.openSurveyActivity(

+                   this,

+                   YOUR_VISIBILITY_ID

+               );

            }

        });

    }

    /*...*/

} 

Set Program Metadata

Use the below APIs to capture metadata from the responses received.

CODE
Dropthought.setSurveyMetadata(Bundle metadata)

Bundle metadata = new Bundle();

metadata.putString("name", "Barney");

metadata.putString("age", "36");

Dropthought.setSurveyMetadata(metadata); 

feedback-img.png

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.