When deploying your Add-On, the application, HTML pages and resources will be packaged within a single iRoar application package (IPK). The iRoar Dashboard mobile application enables you to install the Add-On on the iRoar. During installation, the IPK will be transferred to the microSD card inserted into the iRoar device, while the HTML pages will be installed on the user's mobile device.
The lifecycle of an iRoar application is managed by the system. Once the iRoar device is powered on, the iRoar applications will start execution in the background. Some APIs are ignored if the application is not in focus, or when the system is in low power mode. The applications continue to execute until the iRoar device is powered down, with the exception of the alarm APIs. When the application is uninstalled, it will no longer run on the iRoar device.
An iRoar application is event driven with these three main events:
When an iRoar application starts execution, the entry function @app_start will be called. Initialization required to run the application should be done here. When the @app_start function exits, the application will continue to run, and waits for trigger events such as a button tap.
The following code sample prints "Hello World",
After exiting from the @app_start function, the @event_observer function will be called whenever a trigger event occurs. In this function, you can handle desired events and implement your application's functionality.
The following code sample prints the button ID when button state changes,
Before the application exits, the @app_exit function will be called. The application exits when the user powers down the iRoar, ejects the applications microSD card, uninstalls the application, or when the app_quit() function is called. You should release almost all resources that aren't needed by the user in this function.
The following code sample terminates the application when user taps on the increase volume button and prints "Bye" on exit,