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
Contributor
Posts: 26
Registered: ‎11-10-2013
My Device: Z10
My Carrier: Dialog
Accepted Solution

How to make a QML page to appear only on first launch

How do I make a qml page to appear only on the first time the app is launched? 

 

I need to create a tabbed pane and the number of tabs depends n the input of the user which he provides on the first launch. How do I make this happen?

Highlighted
Developer
Posts: 508
Registered: ‎01-19-2011
My Device: My Trusty Red Plane
My Carrier: Outer Space

Re: How to make a QML page to appear only on first launch

You can use QSettings to store settings.

 

Create two main qmls (mainHasInput.qml and mainHasNoInput.qml). When the user starts your app for the first time, load mainHasNoInput.qml. If the user enters the correct input values, write that into your QSettings. The next time the app launches, you check if a setting was stored into your QSettings. if no, show your mainHasNoInput.qml, if yes, show mainHasInput.qml (which is your 'normal' main screen)

 

for an example how to use QSettings, see https://developer.blackberry.com/native/sampleapps/ -> "Persistant Objects"

-----------------------------------------------------------------------
I'm a bird from outer space. But I'm not flappy o.o
Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: How to make a QML page to appear only on first launch

take a look how I'm showing a Page with EULA only one time:

 

my blog: http://appbus.wordpress.com/2013/10/09/eula-at-first-start-of-app/

or here at BlackBerry Developer Blog: http://devblog.blackberry.com/2013/11/secrets-of-the-blackberry-jam-asia-conference-app-part-1-imple...

 

hope it helps to get the idea

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

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Contributor
Posts: 26
Registered: ‎11-10-2013
My Device: Z10
My Carrier: Dialog

Re: How to make a QML page to appear only on first launch

[ Edited ]

I did as you said, and it works. Thanx alot pyth