Launch a specific form from android

how can I launch a specific odk form, since I've only found it with an id?

Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setData("content://org.odk.collect.android.provider.odk.forms/forms/2");
startActivity(intent);

Hi @George

here you can find a sample app that which has that option (opening a specific form using id).
There is also a pr there that demonstrates how to open a form using jrFormId https://github.com/grzesiek2010/collectTester/pull/25

2 Likes

Hi @Grzesiek2010,
thanks for answering

I have a question: The "jrFormId" is "form_title" or "form_id" name of the form?

It is the form_id...

Thank you very much, you have helped me in a great way, it has worked perfectly.

What would be the solution from an external application built in react native using the URI?

Like this:

const handlerODKSendScreenLink = formId => {
    const odkUrl = `content://org.odk.collect.android.provider.odk.forms/forms/{PATH_TO_LAUNCH_SEND_FORM_SCREEN}`;
    const odkPlayStoreConfig = {
      appName: 'ODK',
      playStoreId: 'org.odk.collect.android',
    };

    // Attempt to open ODK form, or send to Play Store to download ODK App
    AppLink.maybeOpenURL(odkUrl, odkPlayStoreConfig);
  };