Need programming advice on creating an S60 algebra application

I am a newbie started learning S60 a few weeks ago, and now I need to build a very simple "algebra test" application by modifying the "helloworldbasic" application that comes with N97 SDK.

I'm not asking for someone to build the whole application for me - I just need some guides since I got stuck. My objective is to display a dialog showing a random statement (e.g. 2+4=?) containing two 1-digit numbers, ask for user input, then display on screen whether the answer is right or wrong.

I have read some Nokia API documents e.g. S60 application framework handbook etc., and I have figured out how to display a dialog and ask for numeric input. My problems are:

- How to generate random numbers to be displayed in the dialog? I know to use Math::Random() % 10 to make random 1-digit numbers, but I couldn't figure out a way to put the numbers into a string and display it on the dialog.

- Where should I put the declarations of the strings and numbers? The .rss, .rls, or in the HandleCommandL function in UI file?

- How can I display a string on the screen after user clicks "OK"? Where should I put the string, and which function should I call to display it on screen?

- Can someone help me by explaining how the resource files and the UI file (***appui.cpp) work together? I really don't understand how the variables defined in them are accessed by each other (I have been a Java programmer for many years, but this is totally new to me)

Any help on the points I mentioned is appreciated. Please note that this is supposed to be a very simple application, so make it simple :)
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

to start with, visit or for heaps of info on Symbian and S60 development. these sites have dev forums too

re. your immediate questions:

- numbers to string and so forth: (yes, that's me ;) )
then on the dialog you definitely have some controls like labels or editboxes, so display it there; or perhaps the easiest way is to use some message notes - you can add it in UI designer for instance

- declarations: depending on the architecture, you have App, Document, AppUI and some View classes by default, so you can put all declarations according to the logic of your app - it's not much different from Java after all; all declarations will be in *.h files if you want them to be class members, or in *.cpp as global variables, or inside some function as local variables

- look in samples, helloworld definitely displays something on the screen, so you can do the same; now, when you click some menu or softkey, it is usually routed to some HandleCommand() function at the View level - so you can handle it there

- ***appui class is usually working like an engine, so you have your resources for views/forms/dialogs - the UI in other words -  and AppUI class creates those views/forms and manages them

I should admit that above answers may be unclear :), but with Symbian development it usually takes some time to get into it, and sometimes quite a long time. Why can't you just use J2ME if you have long Java history?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bluechordAuthor Commented:
Thank you alexey, I'll read your cookbook and give it a shot firstly :)
I wish I could use J2ME too..but I have to do some Symbian C++ this time.
you could use Carbide.c++ and its UI designers, it makes it a bit easier.
bluechordAuthor Commented:
I'm now totally confused..
In helloworldbasic, all strings are defined in "helloworldbasic_01.rls" file, and I guess it's for localisation? The declaration is in form  -- rls_string *** "hellow world" --

Since now I want to generate two TInt numbers, where should I declare them? I need these two values for the string to be displayed as the label of query dialog, so they need to be accessed at the .rss file.
And you told me to declare them in .cpp file to make them global, but I looked into all cpp files and couldn't find a place to put the declarations..

Also, in the HandleCommandL() function in **appui.cpp, I need to compare the user input to the "correct answer". So the numbers also need to be accessed there.

Anyway, I'm just confused because I didn't find any declaration statements anywhere except in the .rls file, and I couldn't declare TInt variables in there.
yes, rls is for localisation, you could have resource files for diff languages

so you can declare TInt etc class members in eg AppUI header file and use them in cpp.

I'd advise you to have a look at other samples where you'll find all such declarations and examples of usage
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Smartphone Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.