Share this page to your:
Mastodon

Menu

The menu is what is displayed once the device comes up. It looks like this:

menu

There is room for just 9 icons, these are obtained from the apps. There is a version number at the top and a status message about the SD card. I find sometimes the SD card is not detected even when it is in there, but usually popping it out and pushing it back fixes that.

At the bottom we have the date and time (which is updated every 2 seconds or so) and the battery voltage. That voltage shown is rubbish, though. It gives silly values when the USB power is plugged in, and something more realistic when running on battery.

The menu is actually another app so it follows all the app conventions including registering with the AppRegistry. To display the icons it queries the AppRegistry and displays them. It has to ensure that the menu itself is not displayed as an app on the menu.

The AppRegistry itself is basically a jacket around an array of Apps. Because each app extends the App class when an app is instantiated it calls the App constructor, and the App constructor adds the current App object to the AppRegistry. So every app registers itself with the APPRegistry.

The AppRegistry maintains what the currently running app is, so we can do things like:

Appregistry.getCurrentApp()->setup();

and we can fetch an app by name using:

App *notification = Appregistry.getApp("Notification");

Remember every app has to have a name so fetching an app by name will always work (if you have the right name).