Before we start developing, we have to think about what we desire the activity to do. You should ask yourself two central questions.
- Input: What kind of data is at my disposal?
- Output: What kind of data should the activity return
Awesome Calculator - Example
For this tutorial we will develop the following activities:
The first activity takes a string as input, with a simple arithmetic formula of numbers and the four basic operations (plus, minus, multiply and divided) and will perform a calculation on it.
- Name: CalculateFromStringActivity
- Input: Calculation as String, e. g. 1 + 3
- Output: The result is an integer
The second activity is also intended to perform a calculation, but this time the values are passed directly as input.
- Name: CalculateSimpleActivity
- Input: Number 1 as int, number 2 as int and the calculation type should be selectable via a drop-down list
- Output: The result as int