Hi,
i'm trying to use the filecache in Android, but it seems that i get errors, it doesn't want to create the database .....
01-14 11:03:45.934: ERROR/Database(2412): sqlite3_open_v2("/data/data/mobuilding.geopard/databases/network_cache", &handle, 6, NULL) failed
do you have an idea of why ?
thanks you very much !
ok,
here is the code :
final MemoryCache memoryCache = new MemoryCache(1024 * 1024);
final File cacheDir = new File("/sdcard/maps_lib_cache");
if (!cacheDir.exists()) {
cacheDir.mkdir();
}
final Cache fileSystemCache = new AndroidFileSystemCache(pard,
"network_cache", cacheDir, 1024 * 128);
mapComponent.setNetworkCache(new CachingChain(new Cache[] { memoryCache, fileSystemCache }));
and "pard" is the link with the activity i use.
thx again !
i made some search about that,
it seems that it try to open the database but the problem is the database is not created yet ......
well, i tried to create manualy the database, but here is what i get after :
ERROR/Database(7162): CREATE TABLE android_metadata failed
ERROR/Database(7162): Failed to setLocale() when constructing, closing the database
ERROR/Database(7162): android.database.sqlite.SQLiteException: unable to open database file
The Cache index database should be created always automatically, manual creation is probably not good idea. I have not seen such issue, looks like something wrong with your device/emulator. No space to create database? Some other software/config error? Can you create and try with another emulator (with different Android version maybe)?
what is your exact code to define the cache?
/JaakL