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

Native Development

Reply
Developer
Posts: 120
Registered: ‎02-06-2013
My Device: DAB, DAC, Lost red Z10, Regular Replaced Z10, PlayBook

accessing settings in headless part

Hi, any idea how to access the settings of UI part in the Headless part?



Looking for SMTP Servers, Bulk Emails and Bulk SMS services at an affordable price to help boost your business? Look no further. I've the solution for your needs. Contact me now.
Developer
Posts: 120
Registered: ‎02-06-2013
My Device: DAB, DAC, Lost red Z10, Regular Replaced Z10, PlayBook

Re: accessing settings in headless part

and is System Dialog supported in headless? Thanks a lot for the help.


Looking for SMTP Servers, Bulk Emails and Bulk SMS services at an affordable price to help boost your business? Look no further. I've the solution for your needs. Contact me now.
Developer
Posts: 291
Registered: ‎10-15-2012
My Device: bb10 developer

Re: accessing settings in headless part

Headless component cannot access the UI. You can still use QSettings to access settings though..

Developer
Posts: 120
Registered: ‎02-06-2013
My Device: DAB, DAC, Lost red Z10, Regular Replaced Z10, PlayBook

Re: accessing settings in headless part

and how to access the settings of UI in headless. it's mentioned on the official docs that the settings can be shared but I'm not sure how to go about that. any docs or code showing the same ? thanks.



Looking for SMTP Servers, Bulk Emails and Bulk SMS services at an affordable price to help boost your business? Look no further. I've the solution for your needs. Contact me now.
Developer
Posts: 291
Registered: ‎10-15-2012
My Device: bb10 developer

Re: accessing settings in headless part

QSettings

Use the same code in your headless component that you use in your main app.

Do this at start of both parts:

QCoreApplication::setOrganizationName("Company Name");
QCoreApplication::setApplicationName("App Name");

.... then to load / save:

QSettings settings;

// do this in your app
settings.setValue("foo", QVariant(123));

// access the setting in your headless app
qDebug() << settings.value("foo");
Developer
Posts: 1,636
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: accessing settings in headless part

headless and UI live in the same sandbox

 

so you can share settings and more data as you like

use QSettings (as alreeady mentioned in this Thread)

or use JSON files stored in data directory inside your sandbox

 

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 120
Registered: ‎02-06-2013
My Device: DAB, DAC, Lost red Z10, Regular Replaced Z10, PlayBook

Re: accessing settings in headless part

what about system dialog. i could see in the docs that there is no support for the Notification dialog in headless but i guess system dialog must be supported so as to let app get the permission from the user whether or not some events be notified while the app is running in the background.

i managed to successfully connect the 'finished' signal of System Dialog to a slot to handle the signal but the System Dialog box doesn't seem to appear.

any idea what could be the issue ?


Looking for SMTP Servers, Bulk Emails and Bulk SMS services at an affordable price to help boost your business? Look no further. I've the solution for your needs. Contact me now.