Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Web and WebWorks Development

Reply
Trusted Contributor
gazier20
Posts: 120
Registered: 10-25-2010

Disk I/o Error

When I try to open my google gears database, I get always a "Disk I/O" error.

 

What could be the problem ?

 

Thank you so much

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,555
Registered: 10-16-2008
My Carrier: Rogers

Re: Disk I/o Error

- Which OS version are you using?

- Are you using a Simulator or a physical Device?

- Which model of device are you using?

- If you are running the simulator, which Windows OS are you using?

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Trusted Contributor
gazier20
Posts: 120
Registered: 10-25-2010

Re: Disk I/o Error

I'm using the OS 5.

On the simulator, it's ok.

On the device (9700 Bold), I got the disk I/O error after this code :

 

 

var db = google.gears.factory.create('beta.database');
db.open('notesBase');           
db.execute('create table if not exists Notes (id INTEGER,title TEXT,companyName TEXT, sector TEXT, facts TEXT, analysis TEXT,opinion TEXT,PublishingDate TEXT,CurrentPrice TEXT,TargetPrice TEXT,MarketCapName TEXT,CountryName TEXT,RecommendationCurrent TEXT,RecommendationPrevious TEXT,ReutersCode TEXT,BloombergCode TEXT,MarketCap TEXT,Ev TEXT,YtdAbs TEXT,YTDRel TEXT,BenchmarkIndexName TEXT,Phone TEXT,Email TEXT,AnalystPicture TEXT)');          

 

Thank you to help me.

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,555
Registered: 10-16-2008
My Carrier: Rogers

Re: Disk I/o Error

The Bold 9700 does not have a built in eMMC card for storage. It requires an inserted SD card for database storage to work.

Does your device have an SD card inserted?
Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Trusted Contributor
gazier20
Posts: 120
Registered: 10-25-2010

Re: Disk I/o Error

Yes, my device has a sd card.

If I search in the folders on my device, I find my google gear database.

 

Is it possible that the database is "dead" ?

Is it possible that my device do not find the database ?

 

Please use plain text.
Trusted Contributor
gazier20
Posts: 120
Registered: 10-25-2010

Re: Disk I/o Error

I found a solution.

 

Actually, every time I open the index.html page.

I create the database and open the push port  with this function

 

function openPort() {
    blackberry.push.openPushListener(handleReturnData, port);
}

 

I found it's the problem because I need to close the port when I exit the application.

 

function openPort() {
    blackberry.push.openPushListener(handleReturnData, port);
    blackberry.app.event.onExit(handleExit);
}

 

function handleExit() {
    blackberry.push.closePushListener(151);   
    blackberry.app.exit();
}

 

Could you confirm we need to close the port ?

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,555
Registered: 10-16-2008
My Carrier: Rogers

Re: Disk I/o Error

Yes, you will need to close the port when the application exits.
Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Trusted Contributor
gazier20
Posts: 120
Registered: 10-25-2010

Re: Disk I/o Error

Ok, I understand.

 

So it means it's not possible to receive push messages when the application is close, isn't it ?

 

How can I change the icon of my application to indicate there are new push messages available ?

 

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,555
Registered: 10-16-2008
My Carrier: Rogers

Re: Disk I/o Error

For receiving push data in the background you can trap the onExit from blackberry.app and send your application to the background instead of actually exiting.

This way your application will continue to listen on your port.

With the latest 1.5 release of the SDK you can also configure your application to run in the background right after it is installed and also on reboot of the device. This way you can ensure your application is listening for push data even if the user hasn't launched your application by clicking your icon on the home screen
Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Trusted Contributor
gazier20
Posts: 120
Registered: 10-25-2010

Re: Disk I/o Error

Thank you very for all your answers.

 

How do you configure to run in background with the lastest SDK ?

 

I have the Blackberry Widget SDK v1.5.0.18.

Please use plain text.