LukasPaczos / emergency-number

Emergency Number is an app that makes it easier to communicate with emergency services.
GNU General Public License v3.0
7 stars 0 forks source link

Fetching emergency numbers from external API #15

Open LukasPaczos opened 7 years ago

LukasPaczos commented 7 years ago

Refs #6 To fetch emergency numbers I'm using http://emergencynumberapi.com/ which data can be found and updated if necessary here. If there is no available data/internet connection I'm just letting a user type it in by hand. There is also a button which enables to change auto-completed number for a different one.

The API takes a country code as a parameter. First I try to find one via BTS and if that doesn't return anything I use SIM's country code.

Currently, there is the following priority when it comes to choosing a number:

  1. Use 112
  2. Use any other uniform emergency number
  3. Use Police number
  4. Use Ambulance number

On every app start, there is a request for a number sent and compared to the local version. If there are any differences user can: