Search in sources :

Example 1 with ESM_Number

use of com.aware.ui.esms.ESM_Number in project aware-client by denzilferreira.

the class TestESM method testNotificationRetries.

/**
 * This tests the notification re-trigger x times after y seconds have elapsed.
 *
 * @param context
 */
private void testNotificationRetries(Context context) {
    ESMFactory factory = new ESMFactory();
    try {
        ESM_Number number = new ESM_Number();
        // 5 minutes
        number.setNotificationTimeout(5 * 60).setNotificationRetry(// notify the user 3 times, so notification alive for 3 * 5 minutes = 15 minutes
        3).setTitle("Lucky number?").setInstructions("Pick one.");
        factory.addESM(number);
        ESM.queueESM(context, factory.build());
    } catch (JSONException e) {
        e.printStackTrace();
    }
}
Also used : ESMFactory(com.aware.ui.esms.ESMFactory) JSONException(org.json.JSONException) ESM_Number(com.aware.ui.esms.ESM_Number)

Example 2 with ESM_Number

use of com.aware.ui.esms.ESM_Number in project aware-client by denzilferreira.

the class TestESM method testNumeric.

private void testNumeric(Context context) {
    ESMFactory factory = new ESMFactory();
    try {
        ESM_Number q1 = new ESM_Number();
        q1.setTitle("Number").setInstructions("We only accept a number!").setSubmitButton("OK").setTrigger("AWARE Test");
        factory.addESM(q1);
        ESM.queueESM(context, factory.build());
    } catch (JSONException e) {
        e.printStackTrace();
    }
}
Also used : ESMFactory(com.aware.ui.esms.ESMFactory) JSONException(org.json.JSONException) ESM_Number(com.aware.ui.esms.ESM_Number)

Aggregations

ESMFactory (com.aware.ui.esms.ESMFactory)2 ESM_Number (com.aware.ui.esms.ESM_Number)2 JSONException (org.json.JSONException)2