What is a basic app?
A basic application has three basic parts and includes code for starting and initializing an application, performs a function for the user or the system, and usually provides a user interface.
The basic parts of an app are:
This part includes initializing resources, such as variables, calling initialization resources, and connecting to hardware or files. In addition, during initialization, the app registers with various services available from the BlackBerry 10 OS.
- Main Loop
The main loop consists of a loop that keeps running. The main loop usually provides the following application logic:
- event handling
- state and data updates
- rendering and updating any graphics displayed
The main loop is usually where you put your application logic and a majority of the code you write is called from or runs in the main loop. Typically, sub-loops inside the main loop are created to control the execution the application. For example, you may have different loops that control the action in a game and play music.
The cleanup part usually handles deallocating and freeing resources that you had initialized as part of starting your application. Clean-up duties include stopping and ending threads and unregistering events and services used by the app.