I want to use DiskLruCache in my project as explained in Caching Bitmaps, but cannot import the correct lib.
Where can I find the jar containing this class ?
As suggested in similar questions, I added the following line to my build.gradle
:
dependencies {
...
compile 'org.robovm:robovm-rt:+'
}
Gradle seems to find the lib, but my code still does not compile :
package com.example ;
import android.util.LruCache;
import libcore.io.DiskLruCache;
public class ObjectCache {
private LruCache<String, String> memoryCache;
private DiskLruCache diskLruCache ;
public ObjectCache(int cacheSize) {
memoryCache = new LruCache<String, String>(cacheSize);
diskLruCache = null ;
}
}
It fails with following errors :
Error:(5, 18) error: package libcore.io does not exist
Error:(10, 13) error: cannot find symbol class DiskLruCache