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. performance measurement of codecs inside Android

Hi,

I have integrated MP3 decoder inside Android using PV OMX Core .

I profile the Music Application using 'top' command for file
'test.mp3'.

It gives me the complete CPU Load for the music application but I was
more interested in seeing the load due to the MP3 decoder alone.

I used the 'top' command to show CPU load of each 'thread '.
Here I can see two threads in the name 'PV Player' .
e.g.
779   950   2% S  25736K   5848K media    PV player       /system/bin/
mediaserver
779   948   1% S  25736K   5848K media    PV player       /system/bin/
mediaserver

I believe one of these is the component thread and other one for the
Media Engine ???

Can I find out which one is for which ? or Is it possible to give a
name to my 'MP3 decoder' thread.

Regards,

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

2. How to add footer in a list view

Hi.

The foooter for this list view goes out of scope. The header is fixed
but I like the footer also to
be fixed, thus scrolling the list between the header and footer. Cant
get this to work below is my xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
  android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">

        <TextView android:id="@+id/view"
                                                        
android:layout_width="wrap_content"
                                                        
android:layout_height="wrap_content"
                        android:text="Header:"/>

  <LinearLayout
                android:orientation="vertical"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content">

                <ListView android:id="@+id/android:list"
                                                        
android:layout_width="fill_parent"
                                                        
android:layout_height="wrap_content"/>

                <TextView android:id="@+id/android:empty"
                                                        
android:layout_width="fill_parent"
                                                        
android:layout_height="wrap_content"
                                                  android:textSize="20sp"
                                                        android:text="No 
data!"/>

  </LinearLayout>

        <TextView android:id="@+id/summary"
                                                        
android:layout_width="wrap_content"
                                                        
android:layout_height="wrap_content"
                        android:text="Footer:"/>

</LinearLayout>

Any help grateful,
Regards Jonas.

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

3. examples for Saurabh sinha, seema sharma, jyoti gupta

4. Do I have to test my app on Dev Phone for ADC II

5. Moving a View Object in a Circle

6. How to extract views ( e.g. combobox, edit box) from a WebView?

7. errors please help any body