SQLite "attach database" not working in Honeycomb

by Mark Carter » Mon, 14 Mar 2011 18:17:51 GMT


Sponsored Links
 My app makes extensive use of this:

sqldb.execSQL("ATTACH DATABASE ? AS mydb", new String[] { dbFile.getPath() 
});

where the dbFile is stored on External Storage.

The Honeycomb emulator confirms the File.exists() but when I query the 
database, it's as if the database hasn't been attached at all.

Also SQLiteDatabase.getAttachedDbs() only returns <"main", ":memory:"> - 
i.e. a single-item list.

The code works fine in 1.5 through to 2.3.

And I'm not the only one experiencing this: 
 http://stackoverflow.com/questions/5108964/attached-databases-in-honeycomb 

-- 



Re: SQLite "attach database" not working in Honeycomb

by Mark Carter » Tue, 15 Mar 2011 11:31:01 GMT


 A workaround has been posted on the Stackoverflow link.

I've filed a bug report here: 
 http://code.google.com/p/android/issues/detail?id=15499 

-- 


Sponsored Links


Re: SQLite "attach database" not working in Honeycomb

by Vasu Nori » Tue, 15 Mar 2011 17:33:10 GMT


 In Honeycomb, using bindargs for 'Attach' sql statement doesn't seem
to work.

try this instead
    db.execSQL("attach database '" + newDb + "' as newDb");

this should work.

files a bug to address this. thanks for posting this question. (also
answered this question on 
 http://stackoverflow.com/questions/5108964/attached-databases-in-honeycomb. 
again thanks for the pointer)




-- 



Other Threads

1. Any APIs support configuring specific PDE server ?

Carrier want it's navigator use specific PDE server to get location
information
so we need  API that can configure PDE server(IP, Port)
Is it available ?

-- 

2. How to draw an RGB image stored in a ByteBuffer

Hi!

I have a direct java.nio.ByteBuffer containing an RGB image in screen
resolution (800x480).
What is the fastest way to draw this image on screen? Preferably
without copying the data to the java heap since my guess is it will be
copied back to the native side when displaying it anyway.

The images are recieved in the preview callbacks from a modified
camera.

Best regards
David

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Does Android support XGA (1024x768) resolution ?

4. How can I configure TextView to draw text like an anchor

5. SD Card not available to apps when mounted?

6. while onLongClick'ed

7. static context access