Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IImageLoader

interface IImageLoader
Extends com.amazon.apmf.IStandard Interface to load the IImage from a URI.

Methods

load()

IImageLoadRequest* load(string uri, IImageLoadListener* listener, IImageOptions? config)
Initiates an asynchronous image load request. See IImageLoadListener for more details on receiving the IImage result. See IImageLoadRequest for more details on managing a request while it is running.

Parameters

uri
string — Required URI from where image has to be downloaded.
listener
IImageLoadListener* — Required IImageLoadListener which can be used to listen to the image load events.
config
IImageOptions? — Optional IImageOptions using which the download will be processed.

Returns

IImageLoadRequest* IImageLoadRequest on which user can call cancel on.

prefetch()

IImageLoadRequest* prefetch(string uri, IImageLoadListener* listener, IImageOptions? config)
Initiates an asynchronous pre-fetch request. Pre-fetching ensures that subsequent IImageLoader::load requests perform faster through implementation-specific mechanisms.

Parameters

uri
string — Required URI from where image has to be downloaded.
listener
IImageLoadListener* — Required IImageLoadListener which can be used to listen to the image load events.
config
IImageOptions? — Optional IImageOptions using which the download will be processed.

Returns

IImageLoadRequest* IImageLoadRequest on which user can call cancel on.

getImageSize()

com.amazon.kepler.uitoolkit.graphics.Size getImageSize(string uri)
Gets the dimensions (height and width) of the IImage. If there is a cache hit, the dimensions will be fetched from the cache. Otherwise, it will be fetched from the originating source. Note: This is a synchronous blocking call. If the image is not in the cache, it will fetch from the originating source which may involve a network request. Avoid calling on the UI thread if a cache miss is possible.

Parameters

uri
string — Required URI of the IImage.

Returns

com.amazon.kepler.uitoolkit.graphics.Size Dimensions of the IImage.
Last modified on October 29, 2026