Manual
Cairn for Android
The app backs up the phone's photos and videos to a folder on your Cairn server, browses the server's folders, and puts the folders you choose into the system's Files picker. It runs on Android 11 and later. It is in no store yet, so you install its APK, from the release downloads, yourself.
What you need Install Sign in Back up photos In the background Browse Files picker Settings Updates
The screenshots come from an Android 16 phone signed in to a demo server, whose users are alice, bob and carol. Other phones word the system's screens a little differently.
What you need
- The server's address, such as
https://cairn.example.com. - A token for this phone, which whoever runs the server makes for your user, one per
device:
cairn-server token add alice --label android --data <data dir>. A lost phone's token is then taken back alone, bycairn-server token remove <id>, with the ID fromcairn-server token list. - The APK,
cairn-<version>-android.apk, one for every phone, among the files of each release from 0.1.29 on: on the latest release's page here, and GitHub's latest release. Each is signed by the project's key, whose certificate's SHA-256 isdc981e26f3084defacb05268103e31ba30eb7cd6c01734ae9f19742f56009006;apksigner verify --print-certson the APK shows it. Android installs an update only when the same key signed it, so an APK built from the source (bash scripts/release-android.sh, see the README's The Android app) is signed by your own key, and every later one must then be your own build too.
Install
Open the APK on the phone, from a browser's download, the Files app or a chat. From a computer with USB
debugging turned on, adb install cairn-<version>-android.apk installs it instead.
1. A browser asks first whether to keep it: Download anyway, then open the download.

2. Android installs apps only from sources you have allowed. The first time, it says so: tap Settings. If the phone asks which app should open the file, choose Package installer.

3. Turn on Allow app installs for that app. The installer comes back: tap Install.

4. Google Play Protect has not seen the app before and recommends a scan. Scan app sends the app to Google first; Install without scanning installs it as it is.

5. Open starts the app. Afterwards you can turn Allow app installs off again for the browser (Settings › Apps › Special app access › Install unknown apps); turn it back on for the next update.

Sign in
- Server: the address,
https://and all. A server reached over plainhttp://, on a home network say, works only when the address is typed withhttp://. - Token: type it, or copy it and tap Paste token.
- This device's name: shown in each file's history, and the name of its photos' folder. It starts as the phone's model.
- Then Sign in.

Back up photos and videos
After signing in, the Photos tab sets up the backup.


- Folder and Path in it: where on the server they go. The folder is one
of yours that you can write to, and the path starts as
Photos/<this device's name>. - Names: as the camera named them,
20240512_114915.jpg, as Nextcloud's Android app kept them; or date and time first, as Nextcloud's iPhone app named them, so that a folder it filled goes on as it was. Optionally, a folder for each year and month. The line under them shows an example. - Which: a switch for each kind, each with where it is on the phone and how many it holds:
- Camera: on until turned off. It covers DCIM and its folders, but not screenshots.
- Screenshots and screen recordings: off until turned on. This means every folder named Screenshots, ScreenRecorder, ScreenRecords or Screen recordings, wherever the phone keeps it.
- Other apps' folders: WhatsApp's, Telegram's, a browser's downloads, and so on. Each folder that holds photos or videos has its own switch, off until turned on. A folder an app makes later shows up here, off. Until Cairn may see the photos, Choose other apps' folders asks for that access.
- When: in the background only on Wi-Fi (the default), and only while charging if chosen.
Turn on backup asks to send notifications, which Upload now uses, and for access to photos and videos (unless Choose other apps' folders already asked). Choose Allow all: limited access shows the app only the photos you pick. With it the app may also read where each photo was taken, which Android takes out of a photo otherwise.

From then on the tab shows what was sent and what waits. New photos are sent a little after they are
taken, and what waits every hour. Upload now sends at once on any network, shown as a
notification, and goes on with the app closed. What could not be sent is listed with the server's
reason, and Retry. A name the server already has for other bytes gets
(2).
When and Which can be changed here while backup is on:
- Switching a folder on sends what is already in it, or only what was taken since backup was turned on, as chosen at the start.
- Switching a folder off stops what was waiting from it. What was sent stays on the server.
Originals are sent as they are, where they were taken included. A photo deleted from the phone stays on the server, and Turn off backup keeps what was sent.

Phones that stop apps in the background
Android puts off what an app does in the background to save battery, for hours once the app has not been opened for a while. So Turn on backup then asks to leave Cairn out of battery optimization, or, as other phones put it, to let it always run in the background: choose Ignore or Allow. Until it may, the Photos tab says so, with Allow in the background.

Some phones go further: Honor, Huawei, Xiaomi, OPPO, OnePlus, realme, vivo and Samsung freeze an app that has not been opened lately or keep it from starting by itself, and new photos then wait until Cairn is opened. The Photos tab shows when backup last ran in the background. When something waited and the phone had not let it run there for two hours while the app was closed, it says so, with a button to the phone's own setting, or to the app's info where the phone's is not known: This phone has not let Cairn run in the background since 13:17 The note stays until Cairn has run in the background again.
On an Honor phone (MagicOS) the setting is Settings › Battery › App launch: find Cairn and turn off Manage automatically, then in the box that opens leave Auto-launch, Secondary launch and Run in background on. Set it when backup is turned on, rather than waiting for the note: the phone does not say when it holds an app back. dontkillmyapp.com gives each maker's steps.
Browse the server
The Browse tab shows your folders on the server as they are now. A folder you can only read says so.



- The button at the top right switches between a list and a grid of thumbnails.
- A file is downloaded only when it is opened, into a cache that the system empties when it needs room. A video streams. Share hands the file to another app, and a file the app cannot show opens in one.
- The photos this phone sent take their thumbnails from the phone itself. Others come from the server. On mobile data the app reads only the start of a photo, for the small picture a camera puts in it, so a photo without one shows a placeholder until the phone is on Wi-Fi.
In the Files picker
Settings › In the Files picker lists your folders. Each one turned on is a place in the system's Files picker: in the Files app and wherever another app opens or saves a file.

There it is Cairn, with the folder's name under it.

A file is downloaded when it is opened. New files and folders can be added there, and from any app that saves through the picker: a new file is kept in the app and queued like a photo, so it is sent whatever happens to the app or the network. Renaming, moving, deleting and writing over a file are not offered yet; do that on a computer.

Settings
- Account: the server, the user, this device's name and the app's version.
- On this phone: the space the opened files and thumbnails take, and Clear.
- Sign out: photos and files not yet sent are not sent; what is on the server stays.
Updates
The app does not update itself yet. Install a later release's APK over it as above: it keeps its settings and what waits to be sent. Android refuses an APK signed by another key; uninstalling the app to get past that forgets what was waiting.
This manual is also in the repository, as docs/android.md.