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: 144
Registered: ‎12-18-2010
My Device: Limited Edition Z10 & Blackberry Playbook
My Carrier: Rogers Wireless
Accepted Solution

How can I create this sort of Application Structure...

Hi all,

 

I have a question about how to structure my app. Sorry if this is a repeat question, I tried searching but didn't come up with anything.

 

I Want to have my app start up with a single page to display a Log in/ Sign up page, but once the user logs in or registers, I want the app to be displayed as a TabbedPane.  How would I go about that? 

 

Thanks,

Playbook Apps:
Touch Painter, LinkShrink

BB10 Apps:
NoteToSelf , LinkShrink
Developer
Developer
Posts: 132
Registered: ‎01-24-2013
My Device: blackberry z10
My Carrier: none

Re: How can I create this sort of Application Structure...

Save the status of the user (ie whether hes  registered yet  and if necessary his login data) using QSettings

https://developer.blackberry.com/cascades/reference/qsettings.html

 

Each time the app (eg in c++ eg in a function called from main() after the appstarts:

//--------------------------------------------------------------
int main(int argc, char **argv)
{
    Application app(argc, argv);
    
    bool reg = isRegistered(); // query the QSettings entry here
    if(reg)
        showTabbedPane();     
    else
        showRegisterScreen(); // when the user registers write the QSettings here, so next time its isRegistered() returns true;

    return Application::exec();

}

 

 

   

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: How can I create this sort of Application Structure...

You could place a non-peekable, noncancelable Sheet over the TabbedPane.

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: How can I create this sort of Application Structure...

Developer
Posts: 144
Registered: ‎12-18-2010
My Device: Limited Edition Z10 & Blackberry Playbook
My Carrier: Rogers Wireless

Re: How can I create this sort of Application Structure...

[ Edited ]

p8 - Thanks for the reply.  Your solution seems like it would work when the user is starting the application, but in a case where they start it and are not logged in/registered, once they do either option I would want to transition from the single Page to the TabbedPane, is it possible to do this transition and how?

 

I looked at the NavigationPage since you can push and pop pages but IIRC you cannot put a TabbedPane inside a NavigationPane.

 

Thanks

Playbook Apps:
Touch Painter, LinkShrink

BB10 Apps:
NoteToSelf , LinkShrink
Developer
Posts: 144
Registered: ‎12-18-2010
My Device: Limited Edition Z10 & Blackberry Playbook
My Carrier: Rogers Wireless

Re: How can I create this sort of Application Structure...

Zimey - Thanks for the link, seems your search abilities are much more honed than mine.

Playbook Apps:
Touch Painter, LinkShrink

BB10 Apps:
NoteToSelf , LinkShrink
Developer
Developer
Posts: 132
Registered: ‎01-24-2013
My Device: blackberry z10
My Carrier: none

Re: How can I create this sort of Application Structure...

 


Zymatic wrote:

p8 - Thanks for the reply.  Your solution seems like it would work when the user is starting the application, but in a case where they start it and are not logged in/registered, once they do either option I would want to transition from the single Page to the TabbedPane, is it possible to do this transition and how?

 


IN c++ its easy , you just put the code in some other function instaed of main(), and call that function when you want to show one or the other (and the funuction decides which).

 

IN Qml you could create components dynamically ..see eg:

https://developer.blackberry.com/cascades/documentation/dev/dynamic_qml/index.html

 

Best Wishes,

Declan