Try in the 2.2 emulator and post the error log please.
On Thursday, May 17, 2012 6:38:46 PM UTC+1, chronogps wrote:
Hi, here is the sample code :
try
{
File sdcard = Environment.getExternalStorageDirectory();
String dbfile = sdcard.getAbsolutePath() + File.separator+ MyRep +
I made a mistake : the problem is under Android 2.1
The log cat under 2.1 Emulator is :
05-17 19:43:06.536: E/Database(245):
sqlite3_open_v2(/mnt/sdcard/chronogps.db, handle, 6, NULL) failed
05-17 19:43:06.536: W/dalvikvm(245): threadid=15: thread exiting with
uncaught exception
The following code just worked for me on the emulator (android 2.1):
File f1 = Environment.getExternalStorageDirectory();
Log.v(TAG, f1.getAbsolutePath());
String dbFilePath = f1.getAbsolutePath() + File.separator +
extdir.db;
You are right.
I found my problem (which is not in the sample source code I posted first
(that's doesn't help !!!)
File f1 = Environment.getExternalStorageDirectory();
Log.v(TAG, f1.getAbsolutePath());
returns \sdcard under 2.1 and \mnt\sdcard unders 2.2
And I hardcoded
4 matches
Mail list logo