ArViewer  Android Version
Arvos - Augmented reality viewer open source
 All Classes Namespaces Files Functions Variables
Static Public Member Functions | Static Public Attributes | List of all members
com.mission_base.arviewer_android.ArvosCache Class Reference

Static Public Member Functions

static void initialize (Activity activity, long maxAge, long maxFiles, long maxSize)
static void clear ()
static Bitmap getBitmap (String url)
static void add (String url, Bitmap bitmap)

Static Public Attributes

static final String mExtension = ".arvos"

Detailed Description

Caches web files in a folder below the external cache directory or, if it is not available, below the cache directory.

Implements an LRU cache where the maximum age of files, maximum number of files and maximum number of bytes used can be specified during initialization.

Each cached item is stored in a file, the last access time stamp of the item is used as file name. Each file's first line contains the url of the cached item, the cached item itself follows after that line. The static cache instance keeps the list of cached urls and file names in memory for fast access.


Definition at line 57 of file

Member Function Documentation

static void com.mission_base.arviewer_android.ArvosCache.add ( String  url,
Bitmap  bitmap 

Adds a bitmap to the cache.

urlThe url of the bitmap to add.
bitmapThe bitmap to add.

Definition at line 360 of file

static void com.mission_base.arviewer_android.ArvosCache.clear ( )

Clears the cache, deletes all cached items.

Definition at line 260 of file

static Bitmap com.mission_base.arviewer_android.ArvosCache.getBitmap ( String  url)

Returns a cached bitmap or null if the bitmap is not in the cache.

urlThe url to of the bitmap to search in the cache.
The bitmap or null.

Definition at line 298 of file

static void com.mission_base.arviewer_android.ArvosCache.initialize ( Activity  activity,
long  maxAge,
long  maxFiles,
long  maxSize 

Initializes the static cache instance.

activityThe activity using the cache.
maxAgeMaximum age of cached files in milliseconds.
maxFilesMaximum number of files in cache.
maxSizeMaximum total size of cache in bytes.

Definition at line 97 of file

Member Data Documentation

final String com.mission_base.arviewer_android.ArvosCache.mExtension = ".arvos"

File name extension used for files in the cache.

Definition at line 65 of file

The documentation for this class was generated from the following file: