KERN uses Cloudinary to store and serve user profile avatars. Images are uploaded directly from the Android app to Cloudinary, which returns a public HTTPS URL. That URL is then stored in the KERN API, which never handles raw image data itself.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jaimegayo/KERNDOCUMENTATION/llms.txt
Use this file to discover all available pages before exploring further.
Why Cloudinary
Cloudinary serves images through a global CDN, applies automatic format optimization, and removes the need for file storage on the backend server. This keeps the KERN API stateless and fast.Upload flow
User selects a photo
The user taps their avatar on the profile screen. Android’s photo picker opens, allowing them to choose an image from their gallery.
App uploads to Cloudinary
The Android app uses the Cloudinary
MediaManager to upload the image binary directly to Cloudinary. The upload is handled asynchronously — the API server is not involved at this stage.URL is sent to the KERN API
The app sends the URL to the KERN API using the avatar update endpoint:The URL is stored in the
avatar_url column of the users table.Setup
1. Create a Cloudinary account
Sign in at cloudinary.com and create a free account. Note your Cloud Name, API Key, and API Secret from the dashboard.2. Create an upload preset
In the Cloudinary dashboard, go to Settings → Upload → Upload presets and create an unsigned preset. This allows the Android app to upload without exposing your API secret.3. Add credentials to local.properties
Add the following tolocal.properties in the Android project root. This file is excluded from version control.
local.properties
BuildConfig fields via build.gradle.kts:
build.gradle.kts
4. Initialize MediaManager
Initialize the CloudinaryMediaManager in your Application class or the activity that handles avatar selection:
Dependency
The Cloudinary Android SDK is declared inapp/build.gradle.kts:
Using a different image host
Theavatar_url field in the KERN API accepts any valid HTTPS URL. If you deploy your own instance of KERN and prefer a different storage solution — such as AWS S3, Imgix, or your own CDN — you can send any HTTPS image URL to PUT /users/avatar and Glide will load it the same way.
The URL must be publicly accessible over HTTPS. Private or signed URLs that expire will cause broken avatar images after the signature expires.