- C# 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| UniCloud | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
| UniCloud.sln | ||
UniCloud
Nextcloud Client & Sync Provider for Windows Phone 10 (Windows 10 Mobile, UWP).
What it does
- Sign in with your server address using Nextcloud Login Flow v2 (approve in the browser; two-factor works), or with a username + app password. The app password is kept in the Windows PasswordVault and revoked on sign-out.
- files: browse your Nextcloud, tap a file to open it.
- Pictures open in a full-screen viewer: swipe between the pictures in the folder, pinch or double-tap to zoom. It shows the server's screen-sized preview, so browsing is quick on mobile data. From the viewer you can set the picture as your lock screen or background (Start background), save it to Saved Pictures, or open it in another app. The original is copied to LocalState\personalization first, because Windows only accepts personalization images from the app's local folder (formats other than JPEG/PNG are converted to JPEG).
- new folder creates a folder in the current folder (WebDAV MKCOL).
- select (or press and hold an item) turns on multi-select: move the selected items to a folder chosen in the folder picker, download them (folders included) to a folder on the phone, or delete them (they go to the Nextcloud trash bin). Back cancels the selection.
- photos: every folder in the phone's Pictures library (Camera Roll, Saved Pictures, Screenshots, ...) with a
thumbnail strip. Tap the cloud next to a folder to sync it, the same way the Nextcloud apps set up a folder:
pick the on-device folder, then pick the Nextcloud folder (default
/Photos/<folder>), then options:- Sync direction: two-way (desktop-client style), upload only (Auto upload) or download only
- Only on unmetered Wi-Fi, only when charging, also upload existing files,
date subfolders (
yyyy/MM, upload only), what to do if the file already exists - "other folder" in the app bar adds any folder via the folder picker.
- notes: Nextcloud Notes (API v1): search, favorites, categories, grouped by month, edit/create/delete, conflict handling via ETags, offline copy of the list.
- account: quota, sync interval, background sync toggle, sign out.
Sync cadence (the 5-minute question)
Windows 10 Mobile does not let a background TimeTrigger fire more often than every 15 minutes. UniCloud does:
| When | How |
|---|---|
| App open | Syncs every 5 minutes (configurable 1/5/15/30) |
| New photo taken / saved | StorageLibraryContentChangedTrigger on the Pictures library fires a sync right away |
| Phone unlocked, connection restored | UserPresent / InternetAvailable system triggers |
| Otherwise | 15-minute TimeTrigger (the OS minimum) |
Background runs get about 30 s, so each run moves the newest files first and stops cleanly; files over 15 MB wait for the next run while the app is open. A run where nothing changed costs one PROPFIND per folder, because unchanged Nextcloud folder ETags let the engine skip listing them.
How sync decides
A per-folder journal (journal-<id>.json in LocalState) records each file's local size/date and remote ETag after
it was last in sync. Compared with the current state of both sides this gives upload / download / delete / conflict.
- Conflicts (both sides changed): the phone's version is renamed
name (conflicted copy yyyy-MM-dd HHmmss).ext, the server version is downloaded, and the conflict copy uploads on the next run (desktop-client behaviour). - Deletes on Nextcloud go to the trash bin. Deletes on the phone use the default delete option.
- Safety net: if one side suddenly looks completely empty (SD card pulled, folder removed on the server) nothing is deleted on the other side, and a missing Nextcloud folder stops the sync instead of wiping the phone.
Build & deploy
Requirements: Visual Studio 2017/2019 with the Universal Windows Platform development workload and the
Windows 10 SDK 10.0.17763 (any SDK >= 15063 works if you change TargetPlatformVersion).
- Open
UniCloud.sln, choose Debug | ARM, target Device. - Phone: Settings > Update & security > For developers > Developer mode, plug in via USB, unlock the screen.
- F5 (or Build > Deploy Solution).
Command line alternative: build an appx with
msbuild UniCloud\UniCloud.csproj /p:Configuration=Release /p:Platform=ARM /p:AppxBundle=Never /p:AppxPackageSigningEnabled=true /p:PackageCertificateKeyFile=<your.pfx>
then install with WinAppDeployCmd install -file <appx> -ip <phone ip> (Windows 10 SDK tool).
Minimum OS: Windows 10 Mobile Creators Update (10.0.15063).
Layout
UniCloud/
App.xaml(.cs) navigation, back key, in-process background task entry
Models/ Account, SyncFolder, RemoteItem, Note
Services/ Login Flow v2, PasswordVault account, WebDAV, Notes API, HTTP plumbing
Sync/ SyncEngine, journal, folder store, foreground timer, background triggers, photo albums
Views/ LoginPage, MainPage (pivot), ImagePreviewPage, SyncFolderPage, RemoteFolderPickerPage, NoteEditorPage