FILENOTFOUND exception when trying to write SQLITE db

by Behr Apps » Tue, 31 Aug 2010 04:50:29 GMT


Sponsored Links
 I am using the code below to read in a SQLITE db file from a website
and then output it to the apps data/databases folder.  I did something
similar to this in another app, the only difference is that instead of
the web, it read the .db file from the assets folder and that worked
just fine.  The problem I am having here is I get a filenotfound
exception after creating the outputstream.  I checked the DDMS while
the app was running and see there is no /data/data/<package>/databases
folder like with my other app so I don't know if that is the issue.  I
also tried to use the file name with a File class and perform the make
dir method but that did not create it either.  Is there something I am
missing in my manifest to let Android know that I want to use
databases?

        InputStream myInput;
          try {
            URL updateURL = new
                URL(DB_URL + dbName);
              URLConnection conn = updateURL.openConnection();
              myInput = conn.getInputStream();

                  String outFileName = DB_PATH + dbName;

                  OutputStream myOutput = new FileOutputStream(outFileName);

                  byte[] buffer = new byte[1024];
                  int length;

                  while ((length = myInput.read(buffer))>0){
                    myOutput.write(buffer, 0, length);
                  }

--



Other Threads

1. Find me Here application for Android integrating GPS, Maps, Mail, etc.

There's a few applications like this called "FriendFinder".. Check out

http://helloandroid.com
http://anddev.org






-- 
take care,
Muthu Ramadoss.

http://mobeegal.in
find stuff closer.

--~--~---------~--~----~------------~-------~--~----~

2. See "" on your Google homepage

Your friend, [EMAIL PROTECTED], has sent you the following Google 
Gadget and included this message:


See "" on your Google homepage 



--~--~---------~--~----~------------~-------~--~----~

3. trouble dynamically adding LinearLayout with 2 subviews

4. EditText to String to int

5. Help)))) How to develope MMS & VT in Android

6. Updating the view from an external thread

7. Find me Here application for Android integrating GPS, Maps, Mail, etc.