Getting Started with TotalCross using VSCode IDE
How to configure TotalCross to run in VSCode IDE and run your first Hello World application.
You can create your TotalCross applications from any IDE that supports Java and Maven projects, but we highly recommend starting with Visual Studio Code, using the official TotalCross VSCode plugin, as it is a very quick and easy process.
❗ Please make sure that your Visual Studio Code is updated, as some issues with the plugin may occur on older versions.
Install the TotalCross plugin
Step 1: Open Visual Studio Code and go to Extensions.
Step 2: Type TotalCross in the search bar and click to install.
Create a Hello World project
Step 1: Open VSCode Command Palette (CTRL + Shift + P on Windows, ⇧⌘P on Mac), type TotalCross and select TotalCross: Create new Project.
Step 2: Create a folder called HelloWorld and select it.
Step 3: Fill in the prompted questions. GroupId is the domain of your company domain backward as in org.wikipedia
for wikipedia.org
. Feel free to leave it as com.totalcross for this tutorial if you wish.
Step 4: ArtifactId is the name of your application, for this example type HelloWorld. Select the latest version of TotalCross SDK and choose whatever platform you intend to deploy your application.
Step 5: A new window will open with your project. Right click the RunHelloWorldApplication.java
file inside src > main > com > totalcross
and choose Run. The TotalCross simulator will open with your brand new application.
Package your application
Step 1: Open VSCode Command Palette (CTRL+Shift+P on Windows, ⇧⌘P on Mac) and search for TotalCross: Package.
Step 2: When the packaging process is finished the target program will take place inside the folder target/install/<platform>.
Deploy and Run your application
❗ Deployment is currently working only for linux arm programs. This feature performs the implementation and execution of the platform via ssh.
Step 1: Open VSCode Command Palette (CTRL + Shift + P on Windows, ⇧⌘P on Mac) and search for TotalCross: Deploy&Run. If you just want to deploy, choose the option TotalCross: Deploy.
Step 2: Fill in the device information.
Step 3: See the result on a display connected to your device or with a VNC client.
To know more about our plugin, just click here.
You’re now ready to create your first project with TotalCross!