Skip to content

Repository files navigation

SORA

SORA Logo

SORA

Image Loader for Android
Lightweight • Fast • Reliable • Easy to use

AndroidJitPackReleaseLicense

SORA is a lightweight Android image loading library built for API 21+. It is designed to load and render images efficiently with memory and disk caching, SVG support, smart resizing, request cancellation, and graceful fallback handling.

SORA Banner

Current Release

  • Version: 1.0.6
  • Distribution: JitPack
  • Artifact: com.github.EKITEAM:SORA:[Version]

Features

  • Multi-level caching with memory and disk support
  • Network image loading over HTTP/HTTPS
  • SVG rendering support
  • Optional animated image support
  • Smart resizing and downsampling
  • Background loading on worker threads
  • Request cancellation by tag or target
  • Verification keys for recycled views
  • Loading state observation via ImageLoadObserver
  • Memory trimming support
  • Placeholder and error drawables

Requirements

  • Minimum Android SDK: 21
  • Target SDK: 34
  • Java 8 or later
  • Java 11 recommended

Installation

SORA is published through JitPack.

1. Add the JitPack repository

In settings.gradle:

dependencyResolutionManagement {
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}

If your project still uses the older Gradle setup, add JitPack in the root build.gradle repositories block instead.

2. Add the dependency

dependencies {
implementation 'com.github.EKITEAM:SORA:[Version]'
}

3. Add internet permission

<uses-permissionandroid:name="android.permission.INTERNET" />

Quick Start

Load an image into an ImageView

ImageLoader.with(context)
.load("https://example.com/image.jpg")
.placeholder(R.drawable.placeholder)
.error(R.drawable.error)
.resize(300, 300)
.into(imageView);

Observe loading state

ImageLoader.with(context)
.load(url)
.into(imageView, newImageLoadObserver() {
@OverridepublicvoidonStateChanged(ImageLoadStatestate) {
if (state.getStatus() == ImageLoadState.Status.SUCCESS) {
// Image loaded successfully
} elseif (state.getStatus() == ImageLoadState.Status.ERROR) {
LoadErrorerror = state.getError();
// Handle error
}
}
});

Request Builder

MethodDescription
load(String url)Set the image URL (HTTP/HTTPS)
placeholder(int resId)Drawable shown while loading
error(int resId)Drawable shown on failure
resize(int width, int height)Target dimensions for downsampling
allowSvg(boolean)Enable or disable SVG decoding
allowAnimated(boolean)Enable or disable animated drawable support
memoryCache(boolean)Store in memory cache
diskCache(boolean)Store in disk cache
tag(Object tag)Group requests for cancellation
verificationKey(String key)Help prevent recycled-view mismatches

Example

ImageLoader.with(context)
.load("https://example.com/avatar.svg")
.placeholder(R.drawable.ic_placeholder)
.error(R.drawable.ic_broken_image)
.resize(256, 256)
.allowSvg(true)
.allowAnimated(true)
.memoryCache(true)
.diskCache(true)
.tag("profile_screen")
.verificationKey("user_123_" + imageUrl)
.into(imageView);

Request Cancellation

// Cancel by tagimageLoader.cancelRequests("profile_screen");
// Cancel a specific targetimageLoader.cancel(imageView);
// Cancel allimageLoader.cancelAll();

Cache Management

// Clear memory cacheimageLoader.clearMemoryCache();
// Clear disk cacheimageLoader.clearDiskCache();
// Trim memoryimageLoader.trimMemory(level);

API Reference

ImageLoader

MethodDescription
pause()Pause all new requests
resume()Resume processing
shutdown()Shutdown the executor and clear caches
trimMemory(int level)Forward Android trim-memory events

ImageLoadState

StatusMeaning
IDLENo active request
LOADINGRequest is in progress
SUCCESSImage loaded successfully
ERRORLoading failed
CANCELEDRequest was canceled

Additional fields and methods:

  • getUrl() — Original URL
  • getDrawable() — Resulting drawable on success
  • getError()LoadError with type and cause

LoadError.ErrorType

  • NETWORK — Connection or timeout issues
  • DECODE — Failed to decode image data
  • SVG — SVG parsing failure
  • HTTP — Non-200 response code
  • CANCELED — Explicit cancellation
  • UNKNOWN — Any other exception

ProGuard / R8

If you enable obfuscation, add these rules to proguard-rules.pro:

# SORA library
-keep class com.ekidevs.sora.** { *; }
-keepclassmembers class com.ekidevs.sora.** { *; }
# SVG library
-keep class com.caverock.androidsvg.** { *; }

User-Agent

By default, SORA sends:

Sora/`versionName`

The version matches the library versionName.


Contributing

Contributions are welcome.

Please open an issue or submit a pull request: https://github.com/EKITEAM/SORA


Support

For questions, bug reports, or feature requests: https://github.com/EKITEAM/SORA/issues


License

SORA is licensed under the Apache License 2.0.

See the LICENSE file for full details.


SORA — Light up your images.

About

Efficient image loading library for Android (API 21+) with memory/disk cache, SVG, animated images, and network retries.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages