> For the complete documentation index, see [llms.txt](https://docs.firework.com/firework-for-developers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.firework.com/firework-for-developers/flutter-sdk/integration-guide-v2/inject-android-image-loader.md).

# Inject Android Image Loader (Flutter)

You could inject an Android image loader that can be one of the predefined Glide or Picasso or your custom implementation of the `com.firework.imageloading.ImageLoader` interface using your own solution.

#### Inject the Glide

Step 1: add the library dependency inside the `dependencies` block in the `firework.gradle.`

```gradle
dependencies {
  implementation "com.firework.external.imageloading:glide:+"
  ...
}

configurations.all {
  resolutionStrategy.eachDependency { details ->
    ...
    if (details.requested.group == 'com.firework.external.imageloading' && details.requested.name == 'glide') {
      details.useVersion rootProject.ext.get("fwNativeVersion")
    }
  }
}
```

Step 2: add the following codes to the `MainApplication` class

```kotlin
import com.firework.imageloading.glide.GlideImageLoaderFactory
import com.fireworksdk.bridge.flutter.FWFlutterSDK

class MainApplication: FlutterApplication() {

  override fun onCreate() {
    super.onCreate()
    // you need to add the module before the sdk init method
    FWFlutterSDK.setImageLoader(GlideImageLoaderFactory.createInstance(this))
    FWFlutterSDK.init(this)
  }
}
```

#### Inject the Picasso

Step 1: add the library dependency inside the `dependencies` block in the `firework.gradle.`

```gradle
dependencies {
  implementation "com.firework.external.imageloading:picasso:+"
  ...
}

configurations.all {
  resolutionStrategy.eachDependency { details ->
    ...
    if (details.requested.group == 'com.firework.external.imageloading' && details.requested.name == 'picasso') {
      details.useVersion rootProject.ext.get("fwNativeVersion")
    }
  }
}
```

Step 2: add the following codes to the `MainApplication` class

```kotlin
import com.firework.imageloading.picasso.PicassoImageLoaderFactory
import com.fireworksdk.bridge.flutter.FWFlutterSDK

class MainApplication: FlutterApplication() {

  override fun onCreate() {
    super.onCreate()

    // you need to add the module before the sdk init method
    FWFlutterSDK.setImageLoader(PicassoImageLoaderFactory.createInstance(this))
    FWFlutterSDK.init(this)
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.firework.com/firework-for-developers/flutter-sdk/integration-guide-v2/inject-android-image-loader.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
