Creating a BlackBerry SQLite Database: File System Not Ready

My application receives data from the server and stores it in the SQLite database. This works fine in the 9550 simulator ( BlackBerry Storm 2 ), but when I run it in any other simulator, it gives me this error:

file system not ready

Code snippet:

URI myURI = URI.create("file:///store/MyDataBase.db"); 

Why is this happening?

+4
source share
2 answers

It is possible that the repository is not the installed and accessible root of the 9550 file system. You should use javax.microedition.io.file.FileSystemRegistry.listRoots () to get an enumeration of the currently mounted file systems.

+5
source
Richard is right. You need to check the root "storage" of the file system. However, there is an additional wrinkle for using SQLite. RIM only supports SQLite in the eMMC repository. That way, even if a "store" exists, it will only work if the underlying storage is eMMC. It is noteworthy that the BlackBerry Bold 9650 device , AKA Bold2, has a "store", but it is not eMMC, so you cannot place the SQLite database there.

I don't know what a direct way to find out if the eMMC file system is using. I asked RIM and I was told to check the file system size. If it is more than 1 GB, then this is eMMC. It was not a very pleasant answer for me. I have finished checking the "system" file system. This is a read-only file system, but it is present only in the eMMC repository, and if it exists, you can write the database to the root directory "store".

Through the SQLite Developer Guide Overview :

You can use the SQLite API provided in the package net.rim.device.api.database to permanently store application data in eMMC memory or on a microSD card.

+23
source

Source: https://habr.com/ru/post/1332190/


All Articles