@SuppressLint("SetTextI18n")
    private void ensureFormula() {
        final String formulaString = ViewUtils.getEditableText(binding.formulaText.getText());
        try {
            this.formula = Formula.compile(formulaString);
            final Value value = formula.evaluate(varList == null ? x -> null : varList::getValue);
            binding.formulaResult.setText("= " + (value == null ? "?" : value.toUserDisplayableString()));
        } catch (FormulaException fe) {
            this.formula = null;
            binding.formulaResult.setText(fe.getUserDisplayableString());
        }
    }
Allows live-editing of a formula, optionally associated with a Variable List
main/src/main/java/cgeo/geocaching/ui/FormulaEditText.java