# Hello world Source: [https://docs.qualcomm.com/doc/80-41102-1/topic/hello_world.html](https://docs.qualcomm.com/doc/80-41102-1/topic/hello_world.html) This tutorial walks you through creating a Hello World app. It includes how to create a component, bundle the component into an app, install the app onto a target, and test the app. ## Create the component **Sample directories and files** Apps have a hierarchy of folders and files, with the base folder being the name of the app. Each component is encapsulated in it's own subdirectory and includes the .c files and a component definition (.cdef) file (creating a .cdef file is covered later in this tutorial). The app directory includes an application definition (.adef) file. This file is used to combine all the components into executables, configure the process for the executable, and to define the configuration for your app. Example directory structure for Hello World: helloWorld/ ├── helloComponent/ │ ├── Component.cdef │ └── helloWorld.c └── helloWorld.adefCopy to clipboard 1. Create component directory. Create a directory for your component. The directory name will be the component name (this is done for ease of organization and becomes important when including multiple components). $ mkdir helloComponentCopy to clipboard 2. Create C source file. $ vim helloComponent/helloWorld.c # use any editor of your choiceCopy to clipboard Your helloWorld.c should look like this: #include "legato.h" #include "interfaces.h" COMPONENT_INIT { LE_INFO("Hello world!"); }Copy to clipboard 3. Create the .cdef file. TelAF uses definition files(.sdef, .adef, .cdef and .mdef) as instructions to the build tools (mktools) and to tell the mktools how to bind the components, apps, and systems. Component definition files are used to specify the external interfaces and internal content of the components as well as defining the requirements from the system for the component. For example what access does the component need, what API will the component access, what external files will it access, etc. Each component must have a corresponding Component.cdef, which must be included in the same folder as the rest of the component code. Create a cdef file called Component.cdef: $ vim helloComponent/Component.cdefCopy to clipboard Because the helloWorld component doesn't have any external interfaces and you'll be using default build locations you can create a simple .cdef file and only define the sources. Add the following to your Component.cdef file and then save and close. sources: { helloWorld.c }Copy to clipboard You have now successfully created your first TelAF component. Congratulations! ## Create the app Next turn your helloWorld component into an app. Apps are the execution environment for your code, they contain one or more executables that run together in a "Sandbox". Your executables are made by combining one or more components. Processes are the running executables that are actively running in memory. Apps may expose external API's but generally contain all the components, executables, settings, and files to run within its own environment. The application definition file (.adef) builds the instructions to tell the mktools how to build your app. In the helloWorld app you need to tell the mktools to create an executable out of the helloComponent component. The app then needs to run that executable in a process. 1. Create a .adef file called helloWorld.adef: $ vim helloWorld.adefCopy to clipboard 2. Confirm that your .adef file has the following. executables: { helloWorld = ( helloComponent ) } processes: { run: { ( helloWorld ) } }Copy to clipboard ## Build the app For this example your .adef file should contain the the following. executables: { helloWorld = ( helloComponent ) } processes: { run: { ( helloWorld ) } }Copy to clipboard Note: mkapp is the tool used to build the app into a binary package that can be installed on your target. It's important to specify the target that you are building for as mkapp includes the libraries and dependencies needed for your specific target. 1. Source the TelAF app environment setup script from the toolchain path. $ source /opt/qct/sa525m/environment-setup-telaf-appCopy to clipboard 2. From the helloWorld directory run the following command: $ mkapp -t -i helloWorld.adef -C "-O2" -X "-O2"Copy to clipboard Example: $ mkapp -t sa525m -i $TELAF_INTERFACES -i $TELAF_MNGD_INTERFACES helloWorld.adef [9/9] Packaging appCopy to clipboard A new directory \_build\_helloWorld and an update file will be created in your helloWorld directory. ├──_build_helloWorld/ │ └── sa525m │ ... ├── helloComponent/ │ ├── Component.cdef │ └── helloWorld.c ├── helloWorld.adef └── helloWorld.sa525m.updateCopy to clipboard The \_build directory is the intermediate directory where the complier places staging files created during the build process. It can be removed after helloWorld.sa525m.update has successfully been created, though it's helpful in troubleshooting build problems. *helloWorld. sa525m.update* is the package needed to install helloWorld on your target. ## Install and run the app on the target device 1. Push the update package to the target. It's recommended to use Android debug bridge (adb) to push the package from your development host PC to the target. $ adb push helloWorld.sa525m.update /data/Copy to clipboard 2. Install the helloWorld update package on the target. It's recommended to use adb shell to connect to your target and run the installation command. $ update /data/helloWorld.sa525m.updateCopy to clipboard 3. Check the installation status $ app status … [running] helloWorldCopy to clipboard Congratulations! You have successfully installed your helloWorld app on the target device. **Parent Topic:** [Tutorials](https://docs.qualcomm.com/doc/80-41102-1/topic/tutorials.html) Last Published: Aug 06, 2026 [Previous Topic Tutorials](https://docs.qualcomm.com/bundle/publicresource/80-41102-1/topics/tutorials.md) [Next Topic Extend hello world](https://docs.qualcomm.com/bundle/publicresource/80-41102-1/topics/extend_hello_world.md)