Use this short tutorials to get to know how Echo Budget works and what you can do with it. All tutorials are in Python3 and Flask for simplicity purposes. This tutorials do not cover how to write Python of Flask applications, but rather let you get familiar with Echo Budget's possibilities
It is recomended to finish "1. Setting up the service" and "2. Specifying Parameters" before moving to the third section
Echo Budget does not do any calculations on the device and depends on the services, that developers create and share. Android application speaks with services via HTTP requests by sending transactions, optional parameters and waits for the service to return valid data to show
E.g. there are 4 services on the screenshot below. First row consists of 2 TEXT-services (we will speak about it later). App sends current transactions and expects string, that it will display. It can be any string, but keep it short to fit on the majority of screens. In the bottom-left corner there is a MONEY-service. Here app sends the same transactions to this service but expects to receive money amount and currency. As you can see, money fields are formatted differently, because "Total income for each currency" is formatted on the server and "Balance for the Echo Bank" is formatted on device with awareness of the user locale. Bottom-right service asks for some initial setup to work, this topic would be covered in section 2 and 3
First out of three endpoints is the starting point for an Echo Budget app to know, that your service exists.
There are 3 main points in the code-snippet below:
my_service — optional path segment to make distinction between different services on the same flask-app. Any valid path-segment string
metadata — required endpoint. By requesting ".../metadata" the app aquires first knowledge about your app and what type of data to expect from it
{"service_type": "TEXT"} — response body for this endpoint. In this example we will try TEXT type. For mode service types visit Documentation page
This step is optional. Skip it, if your service does not need initial setup
Some services require at least some setup to work. Currently there are 12 different settings you can ask user to fill, which we will try
This endpoint is rather short. It only has to return a simple JSON with list of parameter, which would be specified below. Replace an empty list with list of your parameters
All of the parameters have an id: String field, which has to uniquely specify this parameter for this service. Each parameter also has a hint: String parameter, which briefly describes what is this parameter responsible for
This parameter has to specify type as DATE. Allowes user to select date
{
id: String,
hint: String,
type: String = "DATE"
}