Click here to Skip to main content
Click here to Skip to main content

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

, 28 Jul 2003
Rate this:
Please Sign up or sign in to vote.
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 Wink | ;) .

    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

    Share

    About the Author

    SuperEric

    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! Pinmembercristitomi16-Mar-07 6:06 
    Generalwant to made mobile application in java Pinsusssaourabh25-Aug-04 7:28 
    GeneralI cannot download the demo project Pinmembershreyash1-Jun-04 1:59 
    GeneralRe: I cannot download the demo project Pinmembershreyash1-Jun-04 2:18 
    Generalcould not download Pinmembercyberdang12-Aug-03 18:51 
    GeneralRe: could not download PinmemberSuperEric13-Aug-03 1:37 
    GeneralRe: could not download PinmemberSuperEric14-Aug-03 1:06 
    GeneralHeHeyy Calm Down! PinmemberSuperEric31-Jul-03 1:44 
    GeneralI Gave This Article a 1 Because... PinmemberJohn Simmons / outlaw programmer30-Jul-03 9:01 
    GeneralRe: I Gave This Article a 1 Because... Pinmemberc2j230-Jul-03 21:44 
    GeneralColors PinmemberJonathan de Halleux30-Jul-03 4:02 
    GeneralRe: Colors PinmemberJörgen Sigvardsson30-Jul-03 4:14 
    GeneralRe: Colors PinmemberJohn M. Drescher30-Jul-03 8:09 
    GeneralRe: Colors PinmemberS van Leent30-Jul-03 8:14 
    GeneralRe: Colors Pinmemberleechangjun29-Mar-11 22:56 

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

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

    | Advertise | Privacy | Terms of Use | Mobile
    Web02 | 2.8.1411023.1 | Last Updated 29 Jul 2003
    Article Copyright 2003 by SuperEric
    Everything else Copyright © CodeProject, 1999-2014
    Layout: fixed | fluid