Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry® OS Smartphones

Reply
Highlighted
New Contributor
Posts: 6
Registered: ‎08-23-2013
My Device: Curve 8520
My Carrier: Loop Mobile

FileIOException

Hi,

 

While opening any Image in whatsapp I am getting error message FileIOException: File Not found also I checked at Media settings, there also error msg showing Sqlite error (fillRuntimeDataStore chat_history select): net.rim.device.api.DatabaseException : database disk image is malformed(11)

 

Please help me out to this error message as I am not able to download any images or videos from whatsapp

 

Looking forward your reply and suggestions.

 

Thanks

Contributor
Posts: 47
Registered: ‎08-22-2011
My Device: BlackBerry Curve 3G 9300
My Carrier: Airtel

Re: FileIOException

Hello.

Check You memory card first. If possible try reformatting your memory card after backing up your memory card data.

 

Pull your blackberry mobile battery and put it back. This may solve your problem.

 

Note: More info on when exactly you get that type of message, whatsapp version, other details.. 

 

Have a great time.Smiley Happy

 

Click on Like

If the Problem Solved mark as "Solution" for posts that have solved


Follow morrikevi7 on Twitter

New Contributor
Posts: 6
Registered: ‎08-23-2013
My Device: Curve 8520
My Carrier: Loop Mobile

Re: FileIOException

Thanks for your reply but as you suggested I have done the same thing but still problem not solve so please suggest me another way to get back normal

 

Thanks

 

Contributor
Posts: 47
Registered: ‎08-22-2011
My Device: BlackBerry Curve 3G 9300
My Carrier: Airtel

Re: FileIOException

Give More information on your problem.

Click on Like

If the Problem Solved mark as "Solution" for posts that have solved


Follow morrikevi7 on Twitter

New Contributor
Posts: 6
Registered: ‎08-23-2013
My Device: Curve 8520
My Carrier: Loop Mobile

Re: FileIOException

Hi,

 

See below error msg showing in whatsapp media settings

 

Error : Sqlite error (fillRuntimeDataStore chat_history select): net.rim.device.api.database.DatabaseException: : database disk image is malformed(11)

 

Pls help me out asap 

 

Thanks

Contributor
Posts: 47
Registered: ‎08-22-2011
My Device: BlackBerry Curve 3G 9300
My Carrier: Airtel

Re: FileIOException

Is this error message for particular image or all the images you receive ?

Click on Like

If the Problem Solved mark as "Solution" for posts that have solved


Follow morrikevi7 on Twitter

New Contributor
Posts: 6
Registered: ‎08-23-2013
My Device: Curve 8520
My Carrier: Loop Mobile

Re: FileIOException

Hi,

 

This error comes for all Images and Videos

 

Thanks

Contributor
Posts: 47
Registered: ‎08-22-2011
My Device: BlackBerry Curve 3G 9300
My Carrier: Airtel

Re: FileIOException

[ Edited ]

Hi,

Have You tried deleting the whatsapp application and reinstalling it?

Click on Like

If the Problem Solved mark as "Solution" for posts that have solved


Follow morrikevi7 on Twitter

New Contributor
Posts: 6
Registered: ‎08-23-2013
My Device: Curve 8520
My Carrier: Loop Mobile

Re: FileIOException

 

I have unistall whatsapp and install agin but same problem occur,also i have tride to clik photo there also i can not save images please help me out.

 

I saw on ur help topic its showing need to create some code but i dont know how to create as I am not technical person, I am enclosing the link for the same pls go through and revert me asap

 

http://docs.blackberry.com/en/developers/deliverables/29299/Storing_files_in_the_file_system_1554343...

 

Files created by your app are not automatically deleted when your app is uninstalled.

Smartphones that have built-in media storage have a file system partition called System. You can access this partition with the path file:///system. In BlackBerry Device Software 5.0 and later, the system partition is reserved for system use and is read-only. In BlackBerry Device Software versions earlier than 5.0, the system partition is read/write.

 

Code sample: Creating a folder
import net.rim.device.api.system.Application;
import javax.microedition.io.*;
import javax.microedition.io.file.*;
import java.io.IOException;

public class CreateFolderApp extends Application 
{
    public static void main(String[] args) 
    {
        CreateFolderApp app = new CreateFolderApp();
        app.setAcceptEvents(false);
        try 
        {    // the final slash in the folder path is required
             FileConnection fc = (FileConnection)Connector.open("file:///SDCard/testfolder/");
             // If no exception is thrown, the URI is valid but the folder may not exist.
             if (!fc.exists())
             {
                 fc.mkdir();  // create the folder if it doesn't exist
             }
             fc.close();
         }
         catch (IOException ioe) 
         {
            System.out.println(ioe.getMessage() );
         }
    }
}

 

Code sample: Creating a file
import javax.microedition.io.*;
import java.io.IOException;
import javax.microedition.io.file.*;
import net.rim.device.api.system.Application.*;

public class CreateFileApp extends Application 
{
   public static void main(String[] args) 
   {
      CreateFileApp app = new CreateFileApp();
      app.setAcceptEvents(false);
      try 
      {
          FileConnection fc = 
               (FileConnection)Connector.open("file:///store/home/user/newfile.txt");
          // If no exception is thrown, the URI is valid but the file might not exist.
          if (!fc.exists())
          {
              fc.create();  // create the file if it doesn't exist
          }
          fc.close();
       }
       catch (IOException ioe) 
       {
          System.out.println(ioe.getMessage() );
       }
  }
}

 

Code sample: Writing text to a file
import net.rim.device.api.system.Application;
import javax.microedition.io.*;
import javax.microedition.io.file.*;
import java.io.IOException;
import java.io.OutputStream;

public class AddFileContent extends Application 
{
  public static void main(String[] args) 
  {
    AddFileContent app = new AddFileContent();
    app.setAcceptEvents(false);
    try 
    {
      FileConnection fc = (FileConnection)Connector.open("file:///store/home/user/newfile.txt");
      // If no exception is thrown, then the URI is valid, but the file may or may not exist.
      if (!fc.exists())
      {
          fc.create();  // create the file if it doesn't exist
      }
      OutputStream outStream = fc.openOutputStream(); 
      outStream.write("test content".getBytes());
      outStream.close();
      fc.close();
     }
     catch (IOException ioe) 
     {
        System.out.println(ioe.getMessage() );
     }
  }
}

 

Code sample: Reading sections of a binary file

This code sample demonstrates how to read sections of a binary file by reading header information from a .gif file. The app reads the width and height of the image from the header. To run the code sample, place a .gif file in the root folder of a media card in a BlackBerry® smartphone.

import net.rim.device.api.ui.*;
import net.rim.device.api.io.*;
import javax.microedition.io.file.*;
import javax.microedition.io.*;
import java.io.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;

public class RandomFileAccess extends UiApplication
{
   public static void main(String[] args)
   {
      RandomFileAccess app = new RandomFileAccess();
      app.enterEventDispatcher();
   }
   public RandomFileAccess()
   {
      pushScreen(new HomeScreen());
   }
}

class HomeScreen extends MainScreen
{

   public HomeScreen()
   {
      setTitle("Random File Access Sample");
      try 
      {
         FileConnection fc = (FileConnection)Connector.open("file:///SDCard/test.gif");
         boolean bFileExists = fc.exists();
         if (!bFileExists)
         {
         Dialog.alert("Cannot find specified GIF file.");
         System.exit(0);
         }
         DataInputStream in = fc.openDataInputStream();
         byte[] widthBytes = new byte[2];
         byte[] heightBytes = new byte[2];
		     
         if ( in instanceof Seekable ) 
         {
            ((Seekable) in).setPosition(6);
            in.read(widthBytes,0,2);
		     
            ((Seekable) in).setPosition(8);
            in.read(heightBytes,0,2);
         } 
		     
         int widthPixels  = widthBytes[0]  + 256 * widthBytes[1];
         int heightPixels = heightBytes[0] + 256 * heightBytes[1];
		     
         add(new LabelField("Width: " + widthPixels + "\nHeight: " + heightPixels));
		     
         in.close();
         fc.close();
      }
      catch (IOException ioe) 
      {
         ioe.printStackTrace();
      } 
	} 
}

 

Code sample: Displaying the path to the video folder using System.getProperty()
import net.rim.device.api.ui.component.LabelField.*;
import net.rim.device.api.ui.container.MainScreen.*;
import net.rim.device.api.ui.UiApplication.*;

public class GetVidDir extends UiApplication
{
    public static void main(String args[])
    {
        GetVidDir app = new GetVidDir();
        app.enterEventDispatcher();
    }
    
    public GetVidDir()
    {
        HomeScreen hs = new HomeScreen();
        pushScreen(hs);
    }
}

class HomeScreen extends MainScreen
{
    public HomeScreen()
    {
        LabelField msg = new LabelField(System.getProperty("fileconn.dir.videos"));
        add(msg);
    }
}

 

Code sample: Retrieving a list of mounted roots
import java.util.Enumeration.*;
import javax.microedition.io.file.FileSystemRegistry,*;
import net.rim.device.api.ui.component.LabelField.*;
import net.rim.device.api.ui.container.MainScreen.*;
import net.rim.device.api.ui.UiApplication.*;

public class ListMountedRoots extends UiApplication 
{
   public static void main(String[] args) 
   {
      ListMountedRoots app = new ListMountedRoots();
      app.enterEventDispatcher();
   }
	
   public ListMountedRoots()
   {
      pushScreen(new HomeScreen());
   }
}

class HomeScreen extends MainScreen
{
    public HomeScreen() {
        StringBuffer msg = new StringBuffer( “The mounted roots are:\n”);
        Enumeration e = FileSystemRegistry.listRoots();
        while (e.hasMoreElements()) {
            msg.append( e.nextElement() );
            msg.append( ‘\n’ );
        }
        add(new LabelField(msg));
    }

}
 
New Contributor
Posts: 6
Registered: ‎08-23-2013
My Device: Curve 8520
My Carrier: Loop Mobile

Re: FileIOException

 

Awaiting reply