Skip to content

Launching a Survey from another Application

mnipper edited this page Jul 29, 2014 · 2 revisions

A survey for a specific instrument may be launched from another application. To do so, an intent must be broadcast while the survey application is running.

            Intent i = new Intent();
            i.setAction("org.adaptlab.chpir.android.survey.start_survey");
            i.putExtra("org.adaptlab.chpir.android.survey.instrument_id", REMOTE_INSTRUMENT_ID);
            context.sendBroadcast(i);

The REMOTE_INSTRUMENT_ID refers to the id of the instrument on the server.

Note: This permission is protected with permissionLevel of signature. This means that the other application must be signed with the same key as the Survey application in order to work. In addition, you must obtain the following permission in your AndroidManifest:

    <uses-permission android:name="org.adaptlab.chpir.android.survey.LAUNCH_SURVEY" />