connectiq-ura/connectiq/source/BusStopApp.mc

57 lines
1.1 KiB
MonkeyC
Raw Permalink Normal View History

2021-01-19 13:37:02 +01:00
using Toybox.Application;
using Toybox.Position;
using Toybox.Time;
using Toybox.Sensor;
using Toybox.System;
2021-01-19 13:37:02 +01:00
class BusStopApp extends Application.AppBase {
var view;
var delegate;
var position;
var sensors;
var api_url;
2021-01-19 13:37:02 +01:00
var offset = 0;
var stopId = 0;
function initialize() {
Application.AppBase.initialize();
loadSettings();
}
2021-01-19 13:37:02 +01:00
function onSettingsChanged() {
loadSettings();
}
2021-01-19 13:37:02 +01:00
function loadSettings() {
var api_url_index = 1; //getProperty("api_url_index");
switch (api_url_index) {
case 0:
api_url = "https://localhost:8080";
break;
case 1:
api_url = "https://connectiq-ura.0l.de";
break;
}
System.println(api_url);
}
2021-01-19 13:37:02 +01:00
function onStart(state) {
}
function onStop(state) {
}
//! Return the initial view of your application here
function getInitialView() {
2021-01-19 13:37:02 +01:00
view = new BusStopView(self);
delegate = new BusStopDelegate(self);
2021-01-19 13:37:02 +01:00
return [ view, delegate ];
}
}