Click here to Skip to main content
15,880,503 members
Articles / Desktop Programming / MFC
Article

An Application To Show You How To Simulate A Mobile Set!

Rate me:
Please Sign up or sign in to vote.
2.23/5 (21 votes)
28 Jul 20036 min read 61K   715   18   15
This application is just a simple simulator but its ability is that u can simply add much more properties to ur mobile and the interface and the source code are so separate so u can change the interface with just a low cost!!!

First Dialog Shot:

    Sample screenshot

    Mobile Owner Shot:

    Sample screenshot

    Dialer Shot:

    Sample screenshot

    Introduction

    Most of people may wonder that simulating isn’t a worthy work and is just wasting time. But as an answer to those people I should say simulating actually is not a simple work and it needs so much experience and ability, which differs in case of the project. This program is just a project and its own end is to show the author’s abilities in OOP and other special topics of advanced programming such as exception handling using STL and so forth. And on the other hand it can be used for educational purposes, many users or maybe many beginner programmers need to have some kind of resources to deal with their new problems by using those resources. So this project can be used as a good resource for those people.

    This Project is a simulator of a simple mobile set which has these abilities:

    • Call Records Menu
    • Phone Book Menu
    • Settings Menu
    • Messages Menu

    Note that the structure of this program is in a way that u can add any other abilities to this mobile set.
    Because this program (MS) is a simulator so I should enable all simple actions and simulate them correctly such as sending messages or calling to some one by the mobile owner or maybe receiving messages form another persons. So when u start the MS an intermediate Dialog comes up and ask u if u want to be the mobile owner or the dialer, the first dialog has 5 text boxes which the mobile owner should just fill 2 of them and the dialer should fill them all, the first and the second fields are IP and the PROT of the computer on which the MS as the mobile owner is running, notice that using IP and PORT here is just for simulating this property of real mobile sets that they can call other persons via cables or satellites and here our cable or remote devices is just a Socket. If the dialer enters the same IP & PORT as the mobile owner then they can connect each other by calling or sending messages.

    About The Main Classes:

    This Project has been written by VC++6 and it has so many different classes. Some of them are just practical classes used in the interface of MS but some of them are key classes, which the basis of the project is settled on them.
    The Key Classes Are:

    • Scr
    • BtZero
    • BtOne
    • BtTwo
    • BtThree
    • BtFour
    • BtFive
    • BtSix
    • BtSeven
    • BtEight
    • BtNine
    • BtStar
    • BtSquar
    • BtOk
    • BtCancel
    • BtUp
    • BtDown
    • BtLeft
    • BtRight
    • BtDial
    • BtCancel

    All the above classes are actually the builders of the main parts of the mobile set. Like the screen or any key one the pad like button one, button ok…

    The most important class of all above is the first one “Class Scr” which handles all the actions that I’ve defined in it. This Class has some defined actions that you can see them all in the “Scr.h” file. All Actions that I myself added to the main class are listed below:

    SCRACT_0

    0

    Handles Pressing Button 0

    SCRACT_1

    1

    Handles Pressing Button 1

    SCRACT_2

    2

    Handles Pressing Button 2

    SCRACT_3

    3

    Handles Pressing Button 3

    SCRACT_4

    4

    Handles Pressing Button 4

    SCRACT_5

    5

    Handles Pressing Button 5

    SCRACT_6

    6

    Handles Pressing Button 6

    SCRACT_7

    7

    Handles Pressing Button 7

    SCRACT_8

    8

    Handles Pressing Button 8

    SCRACT_9

    9

    Handles Pressing Button 9

    SCRACT_OK

    10

    Handles Pressing Button Ok

    SCRACT_CANCEL

    11

    Handles Pressing Button Cancel

    SCRACT_DIAL

    12

    Handles Pressing Button Dial

    SCRACT_HANG

    13

    Handles Pressing Button Hang

    SCRACT_OFF

    14

    Handles Turning The Set Off

    SCRACT_ON

    15

    Handles Turning The Set On

    SCRACT_NORMAL

    16

    Handles The Normal Mode

    SCRACT_STAR

    17

    Handles Pressing The Star Button

    SCRACT_SQUAR

    18

    Handles Pressing The Square Button

    SCRACT_BASEMENU

    19

    Handles Showing The Base Menu

    SCRACT_SETTINGSMENU

    20

    Handles Showing The Settings Menu

    SCRACT_RINGSANDBEEPSMENU

    21

    Handles Showing The Rings And Beeps Menu

    SCRACT_MUTEMENU

    22

    Handles Showing The Mute Menu

    SCRACT_ORGANIZERMENU

    23

    Handles Showing The Organizer Menu

    SCRACT_MESSAGESMENU

    24

    Handles Showing The Messages Menu

    SCRACT_SENDMESSAGEMENU

    25

    Handles Showing The Send A Message Part

    SCRACT_CLEARMESSAGEMENU

    26

    Handles Showing The Clear Message Part

    SCRACT_READMESSAGEMENU

    27

    Handles Showing The Read Message Part

    SCRACT_ADDPHONEMENU

    28

    Handles Showing The Add Phone Menu

    SCRACT_READPHONEMENU

    29

    Handles Showing The Read Phone Menu

    SCRACT_CLEARPHONEMENU

    30

    Handles Showing The Clear Phone Menu

    SCRACT_PHONEBOOKMENU

    31

    Handles Showing The Phonebook Menu

    SCRACT_CALLRECORDSMENU

    32

    Handles Showing The Call Records Menu

    SCRACT_RECEVINGMESSAGE

    33

    Handles The Action When A Messages is just received.

    SCRACT_RINGING

    34

    Handles The Action Ringing.

    SCRACT_LOSTCON

    35

    Handles Showing The Connection Is Lost.

    SCRACT_ISOFF

    36

    Handles Specifying Whether The Set Is Off

    SCRACT_BUSY

    37

    Handles Specifying Whether The Set Is Busy

    SCRACT_DIALACT

    38

    Handles Specifying the Action On Dialing Someone Except The Dialer

    SCRACT_VIBRATORMENU

    39

    Handles Showing The Vibrator Menu

    SCRACT_SCREENCOLMENU

    40

    Handles Showing The Screen Color Menu

    SCRACT_SCREENSELCOLMENU

    41

    Handles Showing The Screen Selected Color Menu

    SCRACT_SCREENMENU

    42

    Handles Showing The Screen Menu

    SCRACT_SCREENTXTMENU

    43

    Handles Showing The Screen Selected Text Color Menu

    SCRACT_LEFT

    44

    Handles Pressing The Left Button

    The basis of all key classes is in a way that the interface and the classes are in the maximum independency in comparison with each other.

    That’s because of those defined actions that make the “Scr” class very independent and gives it the ability of being used in different circumstances in different projects.
    For better understanding of the relations between the classes you’d better check the “MS.mdl” which shows you all the relations and you should have the “Rational Rose” Program To Open The .mdl file.
    In the “Scr “ there is a key variable called “stat” with CString type that include the Set’s immediate situation and helps us understand where we are right now!

    By checking the “stat” variable and updating it when ever some changes are made we can easily handle all actions.

    In addition to the main class that handles all actions Just for having the interface and the code production in the maximum range of independency I made a single class for each of the pad buttons like BtZero, BtOne and so forth…

    Lets See What Do We Have In Those Separate Classes For Instance Class BtOk:

    <PRE><P>#include "ShadeButtonST.H"</P>
    
    <P>#include "scr.h"</P>
    
    <P>class BtOk : public CShadeButtonST</P>
    
    <P>{</P>
    
    <P>public:</P>
    
    <P>void OnPressBt(Scr *s)</P>
    
    <P>{</P>
    
    <P>s->PerformAct(SCRACT_OK);</P>
    
    <P>}</P>
    
    <P>void CancelSound()</P>
    
    <P>{</P>
    
    <P>SetSound(NULL,::GetModuleHandle(NULL), TRUE,FALSE);</P>
    
    <P>}</P>
    
    <P>};</P>

    As u can see there are two methods one of them is “void OnPressBt (Scr *s){…}” which is called when ever some one press the ok button and asks the Scr object to perform the SCRACT_OK action by using the PerformAction method. And the other method is for canceling the sound property of one button.

    In the Scr class we have an important function, which handle all the action called PerformAction, and we use this method whenever we want to perform an action.

    How To Use It?

    There Is A Help File,By Pressing F1 While Running The MS You Can Check It.

    You can see other things there and if still you have any question please make me happy and mail me ;).

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here


    Written By
    Iran (Islamic Republic of) Iran (Islamic Republic of)
    well this guy is just the super eric and nothing else my biaography i so complicated u better dont know;)
    actually i love programming and i try to be a professional one so just pray 4 me!!! lol Wink | ;)

    Comments and Discussions

     
    GeneralNice work! Pin
    cristitomi16-Mar-07 5:06
    cristitomi16-Mar-07 5:06 
    Generalwant to made mobile application in java Pin
    skapoor831025-Aug-04 6:28
    skapoor831025-Aug-04 6:28 
    GeneralI cannot download the demo project Pin
    shreyash1-Jun-04 0:59
    shreyash1-Jun-04 0:59 
    GeneralRe: I cannot download the demo project Pin
    shreyash1-Jun-04 1:18
    shreyash1-Jun-04 1:18 
    Generalcould not download Pin
    cyberdang12-Aug-03 17:51
    cyberdang12-Aug-03 17:51 
    GeneralRe: could not download Pin
    SuperEric13-Aug-03 0:37
    SuperEric13-Aug-03 0:37 
    hey budd
    welll actually i dont have any clue that y u cant dl it
    i tried it again and no problem came up so u better try again
    be go0od.
    eric;)

    Life Is Nice But It Is WonderFull If U Be Ayy Super Guy Like ME!! Big Grin | :-D
    GeneralRe: could not download Pin
    SuperEric14-Aug-03 0:06
    SuperEric14-Aug-03 0:06 
    GeneralHeHeyy Calm Down! Pin
    SuperEric31-Jul-03 0:44
    SuperEric31-Jul-03 0:44 
    GeneralI Gave This Article a 1 Because... Pin
    #realJSOP30-Jul-03 8:01
    mve#realJSOP30-Jul-03 8:01 
    GeneralRe: I Gave This Article a 1 Because... Pin
    c2j230-Jul-03 20:44
    c2j230-Jul-03 20:44 
    GeneralColors Pin
    Jonathan de Halleux30-Jul-03 3:02
    Jonathan de Halleux30-Jul-03 3:02 
    GeneralRe: Colors Pin
    Jörgen Sigvardsson30-Jul-03 3:14
    Jörgen Sigvardsson30-Jul-03 3:14 
    GeneralRe: Colors Pin
    John M. Drescher30-Jul-03 7:09
    John M. Drescher30-Jul-03 7:09 
    GeneralRe: Colors Pin
    S van Leent30-Jul-03 7:14
    S van Leent30-Jul-03 7:14 
    GeneralRe: Colors Pin
    leechangjun29-Mar-11 21:56
    leechangjun29-Mar-11 21:56 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.