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
New Contributor
WeCT
Posts: 4
Registered: ‎12-19-2012
My Device: Blackberry bold 9780

How to centralize data in HTML 5?

Hi,

 

How to manage data in HTML5? How to centralize the data using HTML 5?

Please use plain text.
Contributor
Ohope5
Posts: 12
Registered: ‎12-18-2012
My Device: Developer

Re: How to centralize data in HTML 5?

Horizontal centre is easy enough. For text you can use "text-align:center" , and for other things you can make the margin on each side the same or set to "auto" .

 

To centre things vertically is more difficult. If it is a table cell, you can use "vertical-align:middle" . For other things you can use absolute positioning. Read THIS for more methods.

 

All this information is to be used as CSS/with the <style> tag.

 

Hope I helped.

Please use plain text.
New Contributor
WeCT
Posts: 4
Registered: ‎12-19-2012
My Device: Blackberry bold 9780

Re: How to centralize data in HTML 5?

Centralize data means centralizing the database for all the users using the same application.

Please use plain text.
Developer
Philipk
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook

Re: How to centralize data in HTML 5?

Reposting my answer since this thread is probably more relavent then the copy that was posted in the 'Built for BlackBerry thread'.


You could use arrays for your data and then save them to localstorage. 

 


 

 

e.g.

 

items = [{
name: "potion",
amount: "5",
weight: "5lb."
},{
name: "sword",
amount: "1",
weight: "20lb."
}]

 

You have to stringify to save it to localstorage. 

 

localStorage["items"]=JSON.stringify(items);

 

Then when you want to load the localStorage back into your script you have to parse it.

 

items = JSON.parse(localStorage["items"]);

 

_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Please use plain text.
Developer
The_Anomaly
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: How to centralize data in HTML 5?

Am I the only that thinks you're talking about centralizing it online maybe?

 

When I read your question I thought of using a web service or a server to do this...  You could use an existing API in the language of your choice, like PHP or even .NET WCF.

 

That way you users can connect with the app to a centralized database.  Problem will be whether they all have 3G or GPRS connection to connect.

If it helped you, click like. :smileyhappy:
Please use plain text.