loadAreas

suspend fun loadAreas(context: Context, jsonData: JSONObject, infoJson: JSONObject, firstIteration: Boolean = true): List<Area>

Loads all the areas available in the server. Custom progress callbacks:

  • 0/0 paths are being processed.

Author

Arnau Mora

Since

20210313

Return

A collection of areas

Parameters

context

The context used for fetching and putting data into the index.

jsonData

The data loaded from the data module

infoJson

The JSON given by the information endpoint on the server.

firstIteration

Used for making sure no StackOverflowError are thrown.

Throws

When it's the second time the function is called, and no areas get loaded.

When the version given by the server and the expected by the app do not match.