Skip to content

SAP-samples/demo-cap-in-the-pocket

CAP in the Pocket

REUSE status

Smartphones are more powerful then ever, with processors rivaling old laptops. So let’s try to use them like a laptop to develop web-applications on the go. This repository is a demo to show you how to do use run and develop a CAP Java Spring Boot application on your smartphone with SapMachine and how to run VSCode locally to develop and modify it. This, of course, works only on Android phones, as they are a Linux at their core.

This demo consists of a modified cap-sflight sample application (original) that can be built directly on device and a VSCode plugin to simplify running the demo.

This demo is a highly experimental prototype, used only for show-casing the ability of modern technology.

Requirements

For this demo, you need an Android phone with the Termux app installed.

The setup for this demo does neither require root on your smartphone, nor the use of the developer mode.

Setup

Launch the Termux app and set up an emulated Ubuntu environment:

pkg install proot-distro
proot-distro install ubuntu
proot-distro login ubuntu

Clone this repository in the Ubuntu shell:

apt update
apt install git wget
git clone https://github.com/SAP-samples/demo-cap-in-the-pocket
cd demo-cap-in-the-pocket

Install SapMachine and VSCode either by running the ./install.sh script or by running:

# Install SapMachine
wget -qO- https://dist.sapmachine.io/debian/sapmachine.key | tee /etc/apt/trusted.gpg.d/sapmachine.asc > /dev/null
echo "deb https://dist.sapmachine.io/debian/$(dpkg --print-architecture)/ ./" | tee /etc/apt/sources.list.d/sapmachine.list > /dev/null
apt update -y
apt install -y sapmachine-21-jdk

# Install VSCode
wget 'https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-arm64' -O code.deb
apt install -y ./code.deb
# Install the missing packages
apt -y --fix-broken install
rm code.deb

# Install the VSCode plugin
wget https://github.com/parttimenerd/cap-in-the-pocket-extension/releases/download/snapshot/cap-in-the-pocket-0.0.1.vsix .
code --install-extension cap-in-the-pocket-0.0.1.vsix --no-sandbox --user-data-dir ~

For more background information, visit mostlynerdless.de.

Launch

Now you can now run VSCode at port 8080 either by running ./vscode.sh script or by running:

nohup code serve-web --port 8080 --without-connection-token &

And access it in the browser at localhost:8080.

Use the VSCode plugin to build and run the CAP SFlight application.

Contribute

Please look into the subfolders when you want to contribute. Contributions to the VSCode plugin are welcome, just be aware that this whole repository is only used for demo purposes and is highly experimental.

License

Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the subfolders.

About

A demo for CAP Java and SapMachine that runs on a smartphone. This includes a custom-built VS Code plugin.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •