Package com.batch.android.core
Class PushImageCache
- java.lang.Object
-
- com.batch.android.core.PushImageCache
-
public class PushImageCache extends java.lang.ObjectStatic helper to manage cache for push downloaded images
-
-
Constructor Summary
Constructors Constructor Description PushImageCache()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringbuildIdentifierForURL(java.lang.String url)Build a file identifier out of the url of the file (simple md5)static android.graphics.BitmapgetImageFromCache(android.content.Context context, java.lang.String identifier)Get image from cache if available.static voidstoreImageInCache(android.content.Context context, java.lang.String identifier, android.graphics.Bitmap image)Store the given image into cache.
-
-
-
Method Detail
-
storeImageInCache
public static void storeImageInCache(android.content.Context context, java.lang.String identifier, android.graphics.Bitmap image)Store the given image into cache. Identifier should be made usingbuildIdentifierForURL(String)if it comes from an URL- Parameters:
context-identifier-image-
-
getImageFromCache
public static android.graphics.Bitmap getImageFromCache(android.content.Context context, java.lang.String identifier)Get image from cache if available. Identifier should be made usingbuildIdentifierForURL(String)if it comes from an URL- Parameters:
context-identifier-- Returns:
- bitmap if found in cache, null otherwise
-
buildIdentifierForURL
public static java.lang.String buildIdentifierForURL(java.lang.String url)
Build a file identifier out of the url of the file (simple md5)- Parameters:
url-- Returns:
-
-