Skip to content

Remove outdated know issues and cleanup storage README #572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 9 additions & 34 deletions storage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,23 @@ benefits while leveraging Firebase Storage's authenticated storage capabilities.
To load an image from a `StorageReference`, simply use the `FirebaseImageLoader` class:

```java
// Reference to an image file in Firebase Storage
StorageReference storageReference = ...;
// Reference to an image file in Firebase Storage
StorageReference storageReference = ...;

// ImageView in your Activity
ImageView imageView = ...;
// ImageView in your Activity
ImageView imageView = ...;

// Load the image using Glide
Glide.with(this /* context */)
.using(new FirebaseImageLoader())
.load(storageReference)
.into(imageView);
// Load the image using Glide
Glide.with(this /* context */)
.using(new FirebaseImageLoader())
.load(storageReference)
.into(imageView);
```

Images displayed using `FirebaseImageLoader` are cached by their path in Firebase Storage, so
repeated loads will be fast and conserve bandwidth. For more information on caching in Glide,
see [this guide][glide-caching].

## Known Issues

There is a bug in `com.google.firebase:firebase-storage:9.6.1` and earlier that results in
excessive logging when downloading images. You may see messages in your logs like this:

```
W/StorageTask: unable to change internal state to: INTERNAL_STATE_IN_PROGRESS isUser: false from state:INTERNAL_STATE_SUCCESS
```

In production this could slow your app down if you are downloading many images. The suggested
workaround is to disable logging in production by adding the following lines to your
ProGuard configuration (`proguard-rules.pro`):

```
-assumenosideeffects class android.util.Log {
public static int w(...);
public static int d(...);
public static int v(...);
}
```

This will disable calls to `Log.w()`, `Log.d()`, and `Log.v()` but preserve log calls at the
`INFO` and `ERROR` levels. Note that this will only be effective when using
`proguard-android-optimize.txt` as the default ProGuard file in `build.gradle`.

[firebase-storage]: https://firebase.google.com/docs/storage/
[glide]: https://github.com/bumptech/glide
[storage-reference]: https://firebase.google.com/docs/reference/android/com/google/firebase/storage/StorageReference
Expand Down