Classic Form Builder Elements
The iForm 3rd Party Widget is used to communicate between iForm and a custom Android application. This article is designed to go over how to design your own custom 3rd Party Widget for use on the Android Platform.
STEP 1. Calling your Application from iForm
In order to call your application from iForm you must use the Package Name of the Android Application. This is accomplished using iFormBuilder 3rd party widget.
STEP 2. Place the following in your 3rd Party Widget Settings:
Android Package Name:
To obtain package name, simply go to Google Play store, and select that app that you wants to call. For example, the Google Map
Once you selected the Google Map app, you will see the URL as follow:
Simply copy the string after the id=. So the string that you need to paste to the Android Package Name field in FormBuilder will be: com.google.android.apps.maps
Example Package Name: com.myapp.company
STEP 3. Passing Data to a 3rd Party Application
Data is passed into the 3rd Party application via a Name Value Pair.
STEP 4. Returning Data to the iForm App
When tapping on the 3rd party widget it will call the package name specified and pass the above name/value pairs across. These name value pairs can be used to perform different actions in the custom application.
Your custom application performs its actions and captures data.
In order for the 3rd party app to return data back to iForm, the 3rd party app must include the following code in their code.
Line 1: Intent resultIntent = new Intent();
Line 2: resultIntent.putExtra("data", <your data here>);
Line 3: setResult(Activity.RESULT_OK, resultIntent);
Line 4: finish();
- Line 1 is to create a new Intent.
- Line 2 stores the data to be returned in the Extra with the key = “data”.
- Line 3 set the Intent result = RESULT_OK which will become the resultCode in the next section.
- Line 4 calling finish() will kill this activity (app) and as a result, the iForm onActivityResult will get call.