Map API

Nutiteq Maps Lib SDK enables developing advanced mobile mapping applications.
Platforms: Android, RIM BlackBerry, Java ME (J2ME)
Download maps API SDK »
Untitled Document

Products

» View demos
» Downloads

Latest news

Last at Tue, 6 Dec 2011 18:37:53
Topic: New BlackBerry sample app
See more news »

Android : FileCache

6 replies [Last post]
micka
User offline. Last seen 2 years 1 week ago. Offline
Joined: 01/14/2010

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 !

jaak
User offline. Last seen 12 hours 44 min ago. Offline
Joined: 06/19/2008

what is your exact code to define the cache?

/JaakL

micka
User offline. Last seen 2 years 1 week ago. Offline
Joined: 01/14/2010

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 !

micka
User offline. Last seen 2 years 1 week ago. Offline
Joined: 01/14/2010

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 ......

micka
User offline. Last seen 2 years 1 week ago. Offline
Joined: 01/14/2010

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

jaak
User offline. Last seen 12 hours 44 min ago. Offline
Joined: 06/19/2008

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)?

/JaakL