Christian S. wrote:
> So the logcat actually shows no errors at all. The screen on the
> device however give this "application has stopped" error. Nothing
> else.

That's odd. Those error dialogs are always supposed to generate Java
stack traces, AFAIK.

> 2. Do you have some sample code that would show a step-by-step
> approach of the way you just described above? (I am a novice that's
> why ...)
> How can I directly make the application look for the database on the
> SD card?

The following is extremely hackish untested psuedoJava, suitable only
for short-term use in emergency situations involving Christians and
Galaxies:

File rootDir=new File(getFilesDir(), "..");
File dbDir=new File(rootDir, "databases");
File db=new File(dbDir, "yourdatabasenamehere");

if (!db.exists()) {
        File sdDb=new File(Environment.getExternalStorageDirectory(),
"yourdatabasenamehere");
                
        // insert binary file copy algorithm here, from sdDb to db
}

// open and use your database as normal

where the binary file copy algorithm could be:

http://exampledepot.com/egs/java.io/CopyFile.html

This presumes you put a working copy of your database in
/sdcard/yourdatabasenamehere via DDMS or adb push or mounting the SD
card in your desktop environment or whatever.

This is NOT a great way of doing this sort of thing for production, but
for the purposes of a soonish demo, it just might work.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android 1.5 Programming Books: http://commonsware.com/books.html

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to