Lessons · Building apps · 25 of 36
The config block
App name, store id, version, icon and splash screen.
The app's settings live in one config: block, in src/config.vi.
config:
name: "Tasks"
id: com.yourname.tasks
version: "1.2.0"
icon: @icon.png
splash:
color: white
logo: @splash.png
text: "Tasks"
time: 1 second
main home:
arrange: center
children:
title:
text: "Welcome to {config.name}"
| Key | Means |
|---|---|
name |
the app's name under its icon |
id |
the store id, like a reversed web address. Never change it after publishing, or the stores see a different app |
version |
the version people see in the store, like "1.2.0"; raise it for each release |
icon |
the launcher icon (a square picture, 1024 × 1024 is best) |
splash |
the screen while the app starts: color, logo or image, text, seconds |
screens |
changes the sizes where phone, tablet and desktop start (rarely needed) |
config.name (and the other keys) can be read anywhere.
Every example here runs in Vi Studio: open it in your browser (phones too) and press Start learning on the welcome page. Each code block there has a Try it button that runs it in the phone preview.
More in Building apps
- Screensgo_to, go_back, transitions, and phone / tablet / desktop.
- Containers that take valuescard(task): one container, many values.
- Repeating thingsrepeat: task in tasks, grids, index, x, y and .at().
- Reaching other containersInside names, parent.name and top-level names.
- Changing the screenA dot for one change, a block for several; wait and animate.
- Timers and gamesevery(), stop(), on_touch, place: x, y and on_hit.
- Sound and videoplay, loop, stop_sounds, audio and video.
- Files and projectssrc/, every file sees every name, one name in one file.
- Errors and good habitsThe real error messages and their fixes; how to organise a project.
About Vi. Vi is a free, open-source programming language for building real mobile apps. You describe each screen in plain words, and Vi compiles it to React Native (Expo) for Android, iOS and the web. Its editor, Vi Studio, runs on Windows, in any browser and on your phone, with the app running live as you type. Read more about Vi.