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
Contributor
Posts: 12
Registered: ‎03-20-2011
My Device: 9800
My Carrier: none

custom application configuration file or variable

Hello,

I am building an application that will load a JSON configuration pulled from an external server  via HTTP for each customer. I am planning on having the custom download the BB application from my website and I would like add a unique ID to their application so when they load it on the BBlackberry I can go to the server and download their personallized configuration.

 

I was hoping to have an XML file in my BB app that I could modify before they downloaded the app, but everything seems to be compiled and I can not change the applications configuration once build.

 

How can I set a unique ID into a compiled BB app so when it loads on the phone I know what user installed it to get their custom config from my server.  Thoughts ?

 

Andrew

Contributor
Posts: 34
Registered: ‎05-28-2011
My Device: Blackberry Playbook
My Carrier: O2

Re: custom application configuration file or variable

Please treat these as suggestions/ideas as it is very late here and I'm quite tired. You could use the following as a unique device id, and request that the user input their pin when they download the application.

 

http://www.blackberry.com/developers/docs/webworks/api/blackberry.identity.html

 

The other option may be to look at building the configuration at runtime if this is possible and storing it using the HTML5 local storage or SQL lite database. Either of these sound appropriate?

Contributor
Posts: 12
Registered: ‎03-20-2011
My Device: 9800
My Carrier: none

Re: custom application configuration file or variable

Thanks for the suggestions. The suggestion to use the users decive id wont work for me because the app will administered by one person, but shared through their group.

 

If i could build the configuration at run time it would work, but I am not sure if thats possible.

I thought of using the bbwp.exe to compile the code on demand on the server, but i have not dug that deep into it yet. I was hoping there would be an easier way (i.e an uncompiled .xml file or something)

 

Andrew

Contributor
Posts: 34
Registered: ‎05-28-2011
My Device: Blackberry Playbook
My Carrier: O2

Re: custom application configuration file or variable

I think you will struggle to use bbwp in an automated way for the following reasons:

 

You might be able to use the file API's to with a DOMParser to read and parse an xml file stored elsewhere on the playbook but the file APIs are not finalised yet. The other final option might be to write a custom Webworks extension as seen here: http://208.74.204.192/t5/Web-and-WebWorks-Development/Tutorial-for-Writing-WebWorks-Extension-for-Pl....

 

Hope this is of help.

 

Contributor
Posts: 12
Registered: ‎03-20-2011
My Device: 9800
My Carrier: none

Re: custom application configuration file or variable

Thanks for the info genration,

 

I am new a BB development so these concepts are new to me.

 

If i wrote an extension, does that code get compiled when i build the application?

 

Andrew