07-30-2011 07:01 AM
I'm newbie on java and on bb development.
I'm finding hard to understand MainScreen, Screen and how should they be used in a application.
Please dont' send links to documentation as I've read a lot from this forum, pdf bb guides, knowledge base artcles etc. and still can't know how must I organize and master the screens of my app.
My app has about 8 diferent windows(or screens): main window, options window, list of items wondows, detail of item window, welcome window(on the first execution) etc...Currently I have to start app.java wich extends UiApplication, that calls either main or welcome windows who both extend MainScreen.
1-How many MainScreens should one app have? 1?
2-Should have one Main screen and all the the others should be Screens?
3-Between Options window and Main window i don´t know how should i do it in order to update Main window after
changing settings on Options window
4-On the first execution the Welcome window should be called and will have a "continue" button to call Options window and after that it should be called the Main window.
Thks in advance!
Solved! Go to Solution.
07-31-2011 06:23 AM
07-31-2011 11:36 AM
As a newbie, I suspect it would be good if you got a book or did some tutorials, as these typically will provide you with a load of useful background information and will fill in a load of blanks. You can find some tutorials here:
My preferred book is
BlackBerry java Application Development, Beginner's Guide, by Bill Foust.
Anyway some answers:
1. As many as you like, MainScreen does not mean only screen, in this case I think Main is used to indicate that this is the Screen that is mainly used.
2. No - most of my Applications are actually a combination of MainScreens and PopupScreens.
3 Good question and there is no right answer here. Let us call the screen that is going to call the Options Screen, your InitialScreen. So InitialScreen will do a push of a new Instance of the OptionsScreen. Now it could immediately pop itself off the display stack, so it goes away. Now when the user exits your Options Screen, your exit processing will the push a new Instance of your InitialScreen. So the new InitialScreen will pick up the latest values.
You will find the tutorials and books will give you different options.
4. How you navigate between windows is entirely up to you. remember you push to put the Screen (or MainScreen) on the display stack, pop to remove it. You should always have one screen on the Display Stack or you will display a white screen (or the previous contents).
Or and the other thing I would definitely recommend looking at is the samples, they push and pop nicely.
Good luck and have fun!
08-01-2011 07:53 AM