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

Web and WebWorks Development

Reply
Regular Contributor
yamafarooq
Posts: 65
Registered: ‎01-03-2013
My Device: 9810
My Carrier: Tmobile
Accepted Solution

How to use SQLite , How to access local database?

I am creating a mobile app based on JavaScript, CSS3 and HTML5 for IPhone, BlackBerry and Android It is basically a browser based app.

All the data including some part of CSS store to database from server, i am using SQLite, I Have a created a database which store all the file from server then I am copying all the file from local database to mobile database, the software works fine in iPhone.

But when I am running the application in BlackBerry it cannot find the dataset to store the data.

This is the first time I am try to build an application for Blackberry and don’t have any idea. Can anyone help me please?

1-    How to access BlackBerry database”SQLite”?

2-      How to build and install application in blackberry?

With Regards

 

-----
Please press the like button to thank the user that helped you.
Accept as a solution if it solved the problem.
Cheers
Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 614
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: How to use SQLite , How to access local database?

Hello,

 

If you take a look at our website it will help you get started.  http://developer.blackberry.com/html5

 

For WebSQL check out our database docs https://developer.blackberry.com/html5/apis/database.html

 

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
Developer
kpbird
Posts: 23
Registered: ‎01-05-2013
My Device: 9800
My Carrier: IDEA

Re: How to use SQLite , How to access local database?

Please use plain text.
Regular Contributor
yamafarooq
Posts: 65
Registered: ‎01-03-2013
My Device: 9810
My Carrier: Tmobile

Re: How to use SQLite , How to access local database?

Thank you very much Chadtator and kpbird, i read about the articles and find them very helpful, I am fallowing the same process

 

But still can’t access the database it come out with message saying Db Error[object SQLError]

 

function loadDatabase()

{

    db = window.openDatabase("Apperture", "1.0", "Apperture", 1000000);

    db.transaction(loadDbTx, dbError);

}

 

function loadDbTx(tx)

{

    tx.executeSql("select * from ui", [], function(tx, result) {

        if (result.rows.length === 0)

        {

            tx.executeSql("insert into ui values('','','Default','image/banner.png','image/banner.png','#E00000FF','#FFFFFFC0','#FFFFFFC0','#FFFFFFC0','#FFFFFFC0','#FFFFFFB0','#FFFFFFFF','#FFFFFF90','','','')");

//            downloadManifest();

        } else {

            page_init();

        }

    });

    saveMetric("AppOpen", []);

    //doAuthentication();

}

 

function dbError(err)

{

    alert("Db Error first" + err);

}

 

 

I try to install the application into blackberry torch 9810 using Ripple to check what the result is. The application install successfully and when I am trying to open the application it come with fallowing message

 

Error Starting

 

Apperturev1: module ‘apperturev1’ attempts to access a secure API.

 

Building process:

Apperture Version:  1.0.0.0

Platform:  WebWorks

Device:  BlackBerry Torch 9810

OS:  BlackBerry OS 7

Manufacturer:  Research In Motion

Screen:  480x640

Density:  253 PPI

User Agent:  Mozilla/5.0 (BlackBerry; U; BlackBerry 9810; en) AppleWebKit/534.1+ (KHTML, Like Gecko) Version/7.0.0.0 Mobile Safari/534.1

 

Setting 

SDK Path: C:\Program Files (x86)\Research In Motion\BlackBerry WebWorks SDK 2.3.1.5

Project Root: C:\Users\OCP\RippleSites\AppertureBlackBerry\Apperture\www

output folder : C:\Users\OCP\RippleSites\output\new

Enable Remote Web Inspector: unchecked

password:

simulator: 9930-7.0.0.318

 

with regards

 

yama

-----
Please press the like button to thank the user that helped you.
Accept as a solution if it solved the problem.
Cheers
Please use plain text.
Regular Contributor
yamafarooq
Posts: 65
Registered: ‎01-03-2013
My Device: 9810
My Carrier: Tmobile

Re: How to use SQLite , How to access local database?

The problem solved, Thank you guys.
for the database part of the problem, i need to create database using javascript because blackberry don't accept database supplied during packaging,
for the the second part of the problem, we need a signing key

with regards
-----
Please press the like button to thank the user that helped you.
Accept as a solution if it solved the problem.
Cheers
Please use plain text.