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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Contributor
Posts: 26
Registered: ‎08-13-2013
My Device: Developer
My Carrier: Developer
Accepted Solution

file structure

Hi,

 

It is a very basic question but i had to ask.

i am from iOS in which there was a .h and .m file for every xib file.

In blackberry instead of xib for UI we have qml.

can anyone please tell me that how to decide that how many .hpp, .h and .cpp files should be created?

I mean how the number of  qml and .hpp,.cpp,.h files are related? 

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: file structure

if you create a new basic cascades project you have all the hpp/cpp files you need. you can create as many qml files without adding any hpp/cpp files.
only when you want to add new functionality on the native code side.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 26
Registered: ‎08-13-2013
My Device: Developer
My Carrier: Developer

Re: file structure

Thanks for reply, but what is the standard practice to decide, when and why we should create .c or .h files?

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: file structure

As long as you change only the UI there is no need to do so.

But some functionalities may not be available in QML, and while you could put them all in applicationUI.cpp this may get a bit unhandy after a time.

To give you some examples i have created an own class for my database access, PersistenceService.cpp, one for web access (DataService.cpp) etc.
I also have materials which are all in their own class.
Theoretically you could put everything into a single file.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 26
Registered: ‎08-13-2013
My Device: Developer
My Carrier: Developer

Re: file structure

Thanks a lot, Simon!! Smiley Happy