Symbian OS development primary manual 8 multi-thread

xiaoxiao2021-03-05  22

Symbian OS Development Primary Manual 8 Multi-Thread Symbian OS support multi-thread, but it is very small because the official recommendations use Active Object to replace it as much as possible. We will explain the reason for Active Ojbect and recommending it in the next lesson. Considering that a common programmer is a multi-thread is a multi-concept, we will introduce it in the Symbian OS through a very simple example in this lesson. First, the RThread class represents threads, we can create, start, stop, shut down threads through this class, which also includes other useful APIs, you can see the documentation. To create a thread RThread in a total of 3 Create function, basically similar, we are here with the first: TInt Create (const TDesC & aName, TThreadFunction aFunction, TInt aStackSize, TInt aHeapMinSize, TInt aHeapMaxSize, TAny * aPtr, TOwnerType aType = EOwnerProcess ); ANAME: The name of the thread AFunction: The function of the thread to execute ASTACKSIZE: The size of the stack is generally using KDefaultStacksize (default) AHEAPMIZE: The minimum of the pile AHEAPMAXSIZE: The maximum AFUNCTION APTR: AFUNCTION parameters can be arbitrary Pointer atype: Default value for EOWNERPROCESS When a thread is created, it is in an inactive state, to start it, you need to call the Resume () function. Finally, we have to know if the thread has been executed, there are many ways, here is the simplest: semaphore. Here, a multi-thread example is introduced, because the example of multi-thread in the SDK is more complicated, I am in the text version A simple example of HelloWorld has established a very simple example. However, before you modify HelloWorld, it is recommended to make a backup of the original routine. In case you have forgot how to write HelloWorld, you will not go to download a new SDK :) This program creates two threads, they at the same time try to modify Ten integers: NUM, when we run, we will see the value of NUM always hover in the initial value: 100 or so. Modified HelloWorld.cpp at: http: //homepage.ntlworld.com/jiao/symbian_junior_tutorial/less8/HelloWorld.cpp Tint ThreadFunction (TANY * AANY) is a function to be executed, and its name can be arbitrary, but The parameter must be (TANY * AANY). We can use this pointer to pass any data, which can be an integer, Descriptor, an array, and more. The return value must be Tint. My implementation is very simple, it performs 10 changes to NUM, according to the value of AANY to change the direction and amplitude of the change. Wait 0-1 seconds between each change. The lower side DOEXAMPLE is the entry of the program, T1, T2 is two threads, pay attention to cleanupclosepushl after each thread creation, this is the extension of Cleanupstack :: Pushl. If you create T2 directly, I will have an error in the process of creating T2, and the memory allocated by T1 is leaking by User :: Leaveiferror (ERR); In order to avoid this, we have to put T1 into the cleaning stack.

However, remember that our second lesson, R-Class itself does not dynamically distributes memory, he is just a handle of system resources. To recycle resources, it must use its Close function. CleanupClosepushl () is designed for this situation. It puts objects on the cleaning stack and automatically calls the CLOSE function of that object when leaving. Then we create a semaphore to determine if the thread ends. When a thread ends, it calls the SEMAPHORE Signal function to add a value of it. Call the resume to start the thread. When its value is 2 you, we output a NUM value every 1/10 seconds. Finally, T1, T2 is removed from the cleaning stack, and their close functions are automatically called. Dabei is published in 06: 15 Comments (0) / Quote (2) Join Bo City Symbian OS Development Features Symbian OS as a special operating system for mobile phones and PC's operating system has a lot of fundamental different. This article explores these differences. Understanding these differences helps us easier to understand the design of Symbian OS (such as cleaning stack, the concept of two-story builds is difficult to accept on the PC), and also provide guidance for us to develop mobile software. 1. The phone has a small memory, and few shutdown and start, so the Symbian OS must pay attention to the spill of memory, even if there is only one component to leak memory, the user will be notified by the memory, and then can only be restarted To recover memory. Second is an inclination of the wrong inclination, mobile phone users can not tolerate the error that needs to be restarted more than PC users. Because the ordinary mobile phone users are regarded as a common electrical appliance, not a computer. So we have to capture errors in the program as much as possible, and automatically turn off a program to solve the problem. Another point is to pay attention to the consumption of power, such as the user N seconds, there is no backlight. 2. Mobile phone CPUs supporting Symbian are typically at 100MHz-160MHz. Compared to today's PC, this is a very low speed. So when we develop a program that requires a higher CPU, it cannot guarantee that it is as good as running on the mobile phone and in the PC simulator. PC software development has a bad trend in recent years: replacing faster algorithms with faster hardware. Of course, buy faster CPUs is much more easier than design faster algorithms, but we must pursue efficiency of algorithms on devices such as mobile phones. 3. The concept of memory in the Symiban phone is different from the PC. All procedures, including system components, running in their storage address, rather than picking up from hard drives like PC and then running. The Symbian OS itself is mapped to Z: disk in a non-writable 20MB ROM. There is also a RAM, which is used to store temporary data, mapping to C: disc. Generally, the RAM of the Symbian phone is 16MB. However, there is data in C: will be lost when the battery is exhausted or taken out. 4. The display screen of the phone is generally smaller, and the different phones are often different, so we are familiar with the "Worth" mode design interface is not applicable. We need to design a framework provided by many systems, such as Tab Pane, etc. 5. The mobile phone input device greatly distinguishes the PC, in the PC, a large part of the input is completed by the mouse, and the phone does not have the concept of mouse. Only a few high-end products provide a touch screen. So when we design the interface, you should consider how many times do users need to press the button to complete this operation? In addition, many Symbian phones provide 5-way operating rods, but not all, if we develop programs running on more devices, these factors are considered. Symbian OS Development Features Symbian OS has a lot of fundamentally differently available operating systems for mobile phones. This article explores these differences.

Understanding these differences helps us easier to understand the design of Symbian OS (such as cleaning stack, the concept of two-story builds is difficult to accept on the PC), and also provide guidance for us to develop mobile software. 1. The phone has a small memory, and few shutdown and start, so the Symbian OS must pay attention to the spill of memory, even if there is only one component to leak memory, the user will be notified by the memory, and then can only be restarted To recover memory. Second is an inclination of the wrong inclination, mobile phone users can not tolerate the error that needs to be restarted more than PC users. Because the ordinary mobile phone users are regarded as a common electrical appliance, not a computer. So we have to capture errors in the program as much as possible, and automatically turn off a program to solve the problem. Another point is to pay attention to the consumption of power, such as the user N seconds, there is no backlight. 2. Mobile phone CPUs supporting Symbian are typically at 100MHz-160MHz. Compared to today's PC, this is a very low speed. So when we develop a program that requires a higher CPU, it cannot guarantee that it is as good as running on the mobile phone and in the PC simulator. PC software development has a bad trend in recent years: replacing faster algorithms with faster hardware. Of course, buy faster CPUs is much more easier than design faster algorithms, but we must pursue efficiency of algorithms on devices such as mobile phones. 3. The concept of memory in the Symiban phone is different from the PC. All procedures, including system components, running in their storage address, rather than picking up from hard drives like PC and then running. The Symbian OS itself is mapped to Z: disk in a non-writable 20MB ROM. There is also a RAM, which is used to store temporary data, mapping to C: disc. Generally, the RAM of the Symbian phone is 16MB. However, there is data in C: will be lost when the battery is exhausted or taken out. 4. The display screen of the phone is generally smaller, and the different phones are often different, so we are familiar with the "Worth" mode design interface is not applicable. We need to design a framework provided by many systems, such as Tab Pane, etc. 5. The mobile phone input device greatly distinguishes the PC, in the PC, a large part of the input is completed by the mouse, and the phone does not have the concept of mouse. Only a few high-end products provide a touch screen. So when we design the interface, you should consider how many times do users need to press the button to complete this operation? In addition, many Symbian phones provide 5-way operating rods, but not all, if we develop programs running on more devices, these factors are considered. Dabei 18: 28 Posts have been viewed 172 reviews (0) / Quote (10) Join Boki Center Symbian OS and Nokia Series XX I don't know their difference before learning Symbian, thinking SERIES 60, 80, 90 is a different Symbian OS version. In fact, Symian OS is a mobile phone operating system developed by Symbian. It is a system independent of mobile phone hardware, so it can be installed on any mobile phone that meets basic system resource requirements. However, mobile phone manufacturers do not want their mobile interfaces, features and other manufacturers. So generally do some modifications on the basis of Symbian OS. Series 60 is developed by Nokia on Symbian OS, and Series 60 2.0 is based on Symbian OS 7.0s. The earlier is based on Symbian OS 6.x. Nokia Developing Series 60 is not just for our mobile phone series, but also series 60 (or higher) as a platform for other vendors.

So other manufacturers now have three ways to use Symbian OS: 1. Based on pure Symbian OS, this benefit is that Symbian's latest technology can be 8.0 series or higher, and get direct technical support from Symbian. For example, Nokia is like this. 2. Based on UIQ, this is not too big, because UIQ is also developed by Symbian. So love P800, P900, P910, etc. are all. 3. Based on Series 60, they are built in a more tools, more powerful platforms, but also pay higher costs, such as modifying Series 60's functionality to modify more than in pure Symbian OS. Many difficulties. The entire system development is taken by Nokia. (Symbian is neutral, and Nokia is a competitor A) currently uses this method with Panasonic X700, Sendox, etc. Dabei 18: 49 published 291 Reviews (2) / Quote (3) Join Bo Mining Center SYMBIAN OS Development Primary Manual 7 Descriptors September 25, 2004 This article describes Descriptor. The Symbian OS does not use the C-string (char *) or C String of the C . Symbian's string is implemented by Descriptor. Our first Symbian program, the text version of HelloWorld is useful: _LIT (KhelloworldText, "Hello World! N"); console-> printf (khelloworldtext); _lit () is a macro, which declares a Descriptor: KHELLOWORLDTEXT, its content is "Hello World!". The following Console-> Printf is a Descriptor. Descirptor is a flexible design that fully considers the various limitations of small devices. Provide a very class for this, some can be modified, some can't modify, some are placed on the Stack, some placed on the HEAP. There is a structor of the newlc website. Map: http://www.newlc.com/Article.php3? Id_article = 12. It contains eight classes, which are not all Descriptor classes, but it is enough for our course to be used. Where TDESC is the most basic class. All other Descriptor classes are inherited by it. TDES is the most basic class that can be modified. Any class with a C suffix is ​​not modified. Structure Chart below is the memory schematic diagram of each of the most commonly used DEScriptor classes. 5 of TBUFC <5> is its length, it represents the "newlc" string, is not changeable. TBUF <8> 8 is its maximum length, and the current only uses 5 bytes, it is changeable, but pay attention to the length of the content that does not greater than his maximum length TPTRC is a Descriptor pointer, it is a The unmodified pointer points to the address of the unmodified "newlc". TPTR is a modified Descriptor pointer class, pointing to the modified "newlc" address. HBUFC's H represents HEAP, which is specifically used to create a string on HEAP, and the strings of other Descriptor classes are generally on Stack. Generally, you should use the HEAP memory as much as possible, because STACK's memory is more limited, and if you have a large number of strings on Stack, it is easy to cause insufficient memory.

These classes are used, modified, and query their strings. You can refer to the API Reference in Developer Library. _Lit () has a simpler version, two lines in HelloWorld can be rewritten as: console-> Printf ("Hello World! N"))); Dabei is published in 05: 36 Has been viewed 206 reviews (0) / Quote (5) Join Bo Cell Symbian OS Development Primary Manual 6 Cleanupstack and Two-Phase 2004 Symbian C uses new (Eleave) instead of normal New, such as CBAR * PBAR = New (Eleave) CBAR; CBAR * PBAR = New (Eleave) CBAR; There will be insufficient memory. If there is insufficient memory in the PC, we will exit the program, but in the mobile phone can't exit, it is not divided into an abnormality, you need to leave. The following function will leave when the memory is insufficient: Void Foobarl ) {CBAR * PBAR = New (Eleave) CBAR; // a user :: Leaveiferror (PBar-> foo ()); // b Delete PBar; // C} A problem is left as an exception handling. If the above program returns an error value in B line foo (), it will leave, but the memory allocated for the PBAR pointer will leak. In order to solve this problem, use Cleanupstack frequently in the Symbian program. Its typical way of use is as follows: void foobarl () {cbar * PBAR = new (elefee) CBAR; // a cleanupstack :: Pushl (PBAR); user :: Leaveiferror (PBAR-> Foo ()); // B Cleanupstack :: POP (); delete PBar; // C} His role is that before B line, put the PBAR pointer in the cleaning stack, once B The row is left, the cleaning stack will automatically delete the PBAR recycling memory. If the B line passes smoothly, you can take PBAR to take the PBAR. Cleanupstack effectively solves this potential memory leak problem, but this method is not applicable in a special case. That is if the build function of a class is leaving, the NEW will leak for the memory it assigns. (The order in which the build is: system allocation of memory, then running build functions) This issue is imported into the next concept: Two-Phase Construction (Layer 2 Build) Our goal is: Build functions can not leave without leaving! To achieve it must: 1. No L function 2 is used in the build function 2. Unasshed in the build function is required to put the above two operations in the second floor build function: ConstructL. To combine two floors, we need another static function, usually newl or newlc. L Everyone knows The representative leaving, C represents the cleaning stack, and the convenience of Newlc will be explained in detail.

(Here to recommend a very good English Symbian Web site: Basic mode www.newlc.com two-story building is: CHelloWorldBasicAppView * CHelloWorldBasicAppView :: NewL (const TRect & aRect) {CHelloWorldBasicAppView * self = CHelloWorldBasicAppView :: NewLC (aRect ); CleanupStack :: Pop (self); return self;} CHelloWorldBasicAppView * CHelloWorldBasicAppView :: NewLC (const TRect & aRect) {CHelloWorldBasicAppView * self = new (ELeave) CHelloWorldBasicAppView; CleanupStack :: PushL (self); self-> ConstructL (aRect ); return self;} void CHelloWorldBasicAppView :: ConstructL (const TRect & aRect) {// Create a window for this application view CreateWindowL (); // Set the windows size SetRect (aRect); // Activate the window, which makes it Ready to Be Drawn ActiVatel ();} first look at the newlc function, create a checkoWorldBasicAppView instance, then put him on the cleaning stack, then call its second floor build function (can leave), then do not put an instance Return from the cleaning stack. Such a benefit is if we create an object with newlc, then call it to leave the function, you don't have to put it on the cleaning stack because it is already above .newl functionality The same is the same, just to remove the cleaning stack before returning an example. The general Class C class provides newl, not all C classes will provide newlc. Use the cleaning stack to pay attention: 1. Member variables don't need to be put On the cleaning stack, because the instance of the classes they are in it should be placed on the cleaning stack when executing the departled member functions. All members of the member variables Both this example sur fortune. Dabei 33: 01 published 278 reviews (2) / Quote (25) Join Bokia Symbain Mobile Tips September 21, 2004 Reset: Enter * # 7370 # 蓝 蓝 地 地址 Address: * # 2870 # If the mobile phone appears error message can be used to see Error Code: (such as kern-exec 3, you can make you more information on the documentation to this error) FileBrowser (many places are downloaded), in C: / Create a file in System / BootData: Errrd is not necessarily useful on non-NOKIA's mobile phone published in 07: 05 has been viewed 207 reviews (0) / Quote (12) Join Bo Cai Center Symbian OS Development Primary Manual 5 - Leave Leave (I don't know how to translate, let's let off first.) This word is mentioned in the second lesson, knowing it is an exception handling of the Symbain version. This lesson explains in detail its meaning and usage. First we have to understand why you want to leave? When the program is running to a place, it is not possible to continue to exit the program, or when the current state cannot perform a certain action, we cannot simply exit the program, or ignore these errors. The former makes the interface are not friendly, and the latter may lead to an inexpensive issue.

So we need to leave at this point. Let the previous layer using our code to deal with our mistakes. The last layer code can determine how to handle this error according to but the up and down environment. Leaving Basic Usage: Suppose We have a function to extract a array: Tint getl (Tint aindex) {if (aindex <0 | | Aindex> = Karraysize) {user :: leave (kerRargument);} else {return naaray Aindex];}} To use this function, we can: Tint X, Err; Trap (Err, X = GETL (5) IF (Err! = Kerrnone) {// Output error message, etc.} ... First pay attention to function Name, this is a specification: Any function that may leave, the name is ended with L. This includes using any form of Leave (Leave, Leaveifnull, LeaveifeIfEfror, etc.) and can Leave, no Trap dropped their function. The above GetL function will Leave, Kerrargument is the reason for the reason (wrong parameters). We can use the GETL function to capture the leave, so when getL When you leave, you will output an error message. The code using GETL does not necessarily require TRAP to declare his own declaration as the exavable function, but to ensure that these functions should be removed by trap. Graphical interface program framework The TRAP is available at the entry so we can use some universal issues without trap (such as insufficient memory). But text programs generally need us to provide trap. Another thing is that trap must be in a CTRAPCLEANUP The instance can be used later. Text HelloWorld uses the header file CommonFramework, in the Examples / Basics / CommonFramework directory, we can see: ctrapcleanup * cleanup = ctrapcleanup :: new (); // Get clean-up stack trapd (Error, Callexamplel ()); // More Initialization, Then Do Example // Trapd is Tint Error; Trap (Error, Callexamplel ()); Abbreviation version. delete cleanup; // destroy clean-up stack is also said There is no CTRA in your process. When the PCLEANUP instance, you need to create it to use Trap, and then remove this instance when you no longer use trap. With the foundation of leaving, let's next class can talk about the concept of Cleanupstack and Layer. After that, everyone will not feel that the construct of instances in the Symbian program looks complete. Exercise: 1. Create a LEAVE function in HelloWorld and call in doexamplel () and see what is not tramp. (The TRAP in CommonFramework is then DOEXAMPLE, and what is the difference in seeing the results? Dabei is published in 05: 21 Comments (1) / Quote (7) Join Bo Cai Center SYMBIAN OS Development Primary Manual (4) MMP, PKG File and Makesis Tools September 20, 2004 This class Our explanation MMP files, PKG files, and how to make SIS files with Makesis to install the program to your phone.

Before you begin, it is necessary to mention the directory specification of the Symbian OS program. You can put all header files, original files, MMP files, resource files, etc., but in order to use more efficient use, generally put the source files Under / SRC, the header file is placed in / inc, Bld.inf, and the MMP file is placed in / group, sis, and the pkg file is placed under / sis. First, find the HelloWorldBasic.MMP file in the group directory, which consists of a series of attributes: Target is the target file name TargetType target type, which is the extension of the target file, APP represents this is an application of a graphical interface (Application) The HelloWorld of the text interface will also see other extensions, such as: DLL, AGT, PRT, etc., there are two UIDs here, they are used to identify our programs, all graphical interface programs A UID is the same: 0x100039CE, the second is the unique UID of our program, need to apply from Symbian. However, in the development phase, you can use 0x0100000000-0x0fffffff. TargetPath target files After installation, the SourcePath source path, the source code file can be stored in multiple different directories, and the compiler will automatically go to these directories when compiling. Look for the Source source code file resource resource file, this approximate exceeds the scope of this tutorial, because this tutorial does not explain in depth how to write a graphics UserinClude user header file path, used to store user-defined header files SystemInClude system headers File path library These is your program compiled library files and then we overview of the PKG file, open helloworldbasic.pkg, it is not difficult to see what is "';' starting," the language is English, below One line is the application information # {"helloworldbasic"} is the application name, 0x10005B91 is the UID, 1, 0, 0 is the version number. Below this is the platform information 0X101F7960 represents Series60 V2.0, " 0, 0, 0 "is a version number that has not been used, it must be" 0, 0, 0 ", {" series60ProductID "} is a platform information description, this string will be on the user attempting to install the program to an incompatible platform The appearance. Then below is the installation file, the left is the path to the target program on your machine, the right is the path on the device, helloworldbasic.app is the target file, HelloWorldBasic.RSC is a compiled resource file. With the above Based, we can compile the SIS file. A total of 2 steps: 1. Enter the / group directory, enter BLDMAKE BLDFILES, the same as that previously speaking, then: Abld build thumb urel, "abld build" is compiled Command, "thumb url" is a compilation target, and the general mobile phone format is thumb. If you use the command behavior Windows, you can use Abld Build Wins Udeb (Urel). "UDeb" represents Debug Build, "Urel" Represents Release Build, The former is used to develop, the latter is used for issuance. 2. Enter / SIS, enter Makesis HelloWorldBasic.pkg, and then HelloWorldBasic.SIS is created.

Below you can use Bluetooth, or USB and other communication methods to transfer this SIS file to your Symbian mobile phone. Installation, execution, good luck! :) Dabei Published 486 Comments (0) / Quote (1 Join Bo Mining Center Symbian OS Development Primary Manual (3) The 4 basic graphics interface in the GUI program is complicated than text. Many! People who have done Windows graphics and command liners should be able to understand this. This HelloWorld has 4 classes, which are indispensable in the Symbian OS. Any graphics program in the Symbian OS. The basic framework of the interface program makes the programmer easy to know where some code should be placed, such as the code of the drawing should be placed inside the view, and when we read a program, if we care about the program The data structure is to see the implementation of the Document class. The CexampleApplication Application class has two effects: the first is to set the properties of this application, such as the UID, each application has its unique UID. Const Tuid KuidHelloWorld = {0x10008ACE}; kuidHelloWorld is this HelloWorld's UID., Appdlluid () provides the UID of this application to the high-level framework, and the framework uses this to identify our program. In addition, it is an instance of a Document class, so we only need Two functions: appdlluid and createDocument.cexampleapplication Inherit from CeikApplication, many do not need us to define functions to be included in CEIKApplication CeixAmpleDocument Document class is the data model of the application, if this program is based on file, it is responsible for the program Document operation. Our HelloWorl does not involve any file, but we still need this class because it is also responsible for manufacturing an instance of the UI class. Although the name is "user interface", he is not a visible component, It manufactures an example of the View class, and it is more important task to assign commands and events, such as what is the menu command to determine how to process, assign it, what kind of function. Another keyboard event is determined by the UI to assign to that control. Detection .HandleCommandl () This function is used to handle the command. The CexampleAppView View class is a visible control, which is responsible for screen display, and can also provide the corresponding function to respond to the relevant event. Depicting the code is placed in Draw Function Both declarations of these four classes are placed in the corresponding header file, which is implemented in the corresponding CPP, in addition to this, you will find another source file: HelloWorldBasic.cpp. This file is the HelloWorld entry, which is simple, which is an instance of an Application class. Therefore, this document is similar in engineering in most graphical interfaces, just the name of the Application class to change accordingly. This lesson we talked about 4 basic classes in the Symbian OS graphics program and the entrance of the program. Next lesson we speak MMP files and PKG files in HelloWorldbasic. Then we will overview how to generate the SIS file, that is, the installation file of the phone. Finally, our HelloWorld can run on the phone that supports Symbian! Exercise: 1. By setting breakpoints, observing the flow of the entire program, each class is created, and the flowchart is drawn on the paper.

Dabei 07: 33 published 229 reviews (0) / Reference (4) Join Bo Mining Center Symbian OS Development Exercise 2 1. The basic type, C-Class, member variable, enumeration in the HelloWorld of the graphics interface , Quantitative and parameters, please find out the code specification that is taught in the second lesson. 2. A lot of C-CLASS in the HelloWorld of the graphics interface, pay attention to see the code that creates their objects, what is the difference between the standard C ? Dabei 07: 37 published 496 reviews (1) / Reference (31) Join Bo City Symbian OS Development Primary Manual (2) Basic Data Type Symbian OS uses object-oriented C , but also standard C has some differences. For example, Symbian OS has no standard exception handling, because C is still standardized in C when designing Symbian OS. So Symbian has designed its own exception handling mechanism: trap, leave. In addition, the basic type of today is going to speak. Symbian basically does not use any standard C basic type, well known, different C editors are different from int, unsigned int, so use Tint8, Tint16, Tint32 in Symbian OS. But if you don't have a good reason to use a certain length, use Tint. There are many other types that follow this principle.

For example, TBUF8, TBUF8, TBUF16 can be best used for TBUF. Type Description Tint8, Tuint8 8-bit integer TINT16, TUINT16 16-bit integer TINT32, TUINT32 32-bit integer TINT, TUINT (32-bit) integer TREAL32, TREAL64 Real Ttext8, Ttext16 Character, equivalent to unsigned char, unsigned short int TBool Tany is equivalent to the Void code specification Symbian OS uses a lot of code specification, using them can enhance the readability of Symbain code, some specification is even strict, such as class name: Symbian OS class has a total of 6: Type example Description T Classes TDESC, TPOINT This class can be used as the basic type because they are usually small, and there is no destructive function C classes cconsolebase, CACTIVE this class is Symbian uses the most class, C represents them inherited from the CBase class, they must have a parsive function because their objects are created in the HEAP R Classes RFile, RTIMER R represents the resource (Resource), which is just a system resource handle, They are created on stack, but the resources they use are created on the HEAP. When using the resource, the class () m classs meikmenuobserver is a empty interface, which needs to inherit Static Classes User, Math, Math Class only has a static function, generally library functions STRUCTS SEIKCONTROLINFO C - STRUCT variable Name: Category Example Description Enumeration Emonday, ETESDAY E represents Quit Quantity KmaxFileName K Represents Quantifier Variable IDEvice, IX i represents Member Variable Parameters Adevice, AX A representative Particular Variables Device, X local variables There are no fixed specifications. In addition, the function is named, but it is understood after leave concept, so it will not be introduced here. This class is very boring, but it has been cleared some concepts. Next lesson Let's take a closer look at the HelloWorld. Dabei Published in 04: 41 (0) / Quote (Johere) Symbian OS Development Exercise 1 1. HelloWorld: Series60ex / HelloWorldbasic 2. This HelloWorld is more complicated, and there is a total of five major original files, guess each file: helloWorldBasicAppui. CPP helloworldbasicappview.cpp helloworldbasic.cpp Dabei at 04: 25 Published 198 Reviews (2) / Quote (5) Join Bo Mok Center Symbian OS Development Primary Manual (1) Introduction Symbian OS is the current application Many mobile phones in the Smart Phone operating system. NOKIA, Panasonic, Siemens, Sony Ericsson are based on this system. Unfortunately, the domestic information on Symbian OS is really small.

So I plan to write a primary tutorial according to my own (shallow) experience, let more people know Symbian OS. Staying Symbian OS, probably many people will think of NOKIA Series 60, 80, etc. Every Symbian alliance mobile phone manufacturer will add your own things on pure Symbian OS. Series 60 is a very popular software development kit, 7650, 3650, n-gage, etc. The example I use here can be running on Series 60. But I am here is a pure Symbian OS instead of series 60, this benefits are: With this foundation, we can use Symbian OS mobile phones. Development without being limited to some special APIs such as SERIES 60. This makes your development results on more devices. Then we need series 60 SDK, in http://www.forum.nokia.com/main/0,6566,034-4,00.html download, install SDK, detailed steps I will not describe it here. If you have any questions, you can ask me here. After installation, it is set to test the basic path. Open a command line window, enter EPOC, if you see the simulator run, you have already installed it. If not, provide error message when you ask questions. With SDK, we can already start developed! However, the development environment is very important, and any Symbian OS program should involve multiple files. Symbain recommends using Metrowork CodeWarrior, but considering that the popularity of VC6 should be higher, I use Visual C 6.0 here. You can also use VC. Net However, the Chinese SDK does not support VC7, you need to download English. You will use VC7 when you appear vc6 in the command line. Before explaining our first Hello World program, I want to simply talk about the file structure of the Symbian OS project, we need to create 4 files: bld.inf configuration file * .MMP project file * .cpp source code file *. H Head File Our Hello World Project, BLD.INF is as follows: Prj_MMPFiles HelloWorld.mmp Only two lines, meaning: this profile will be compiled with: helloWorld.mmp. HelloWorld.mmp is slightly more complicated, not there Here you explain, you only need to know which source files are included in the definition project, which of which of which LIB files can be. Basic HelloWorld example c: /symbian7.0s/series60_v21_c/examples/basics/helloWorld. If your installation path is different, you need to change accordingly. Because it is very simple, this is probably the only item in all examples that don't have a header file. HelloWorld.cpp is as follows: #include "commonframework.h" local_c void doexamplel () {_lit (KhelloworldText, "Hello World!"); Console-> printf (khelloworldtext);} You only need to know _lit before we explain Descriptor "Hello World!" This normal string is converted into a string format of the Symbian OS and stores in the change Khelloworldtext. Console-> Printf (..) is to print this string to the command line.

Then now we need to compile this project, enter Examples / Basics / HelloWorld in the command line, enter BLD Makefiles, then Abld Makefile VC6, which is the basic step of creating a VC project file. Then open Visual Studio, open the workspace, in C: /Symbian/7.0s/series60_v21_c/epoc32/build/symbian/7.0s/series60_v21_c/examples/basics/helloworld/helloworld/wins. Analyze this huge path You will find that it is divided into 4 paragraphs: 1. C: /symbian7.0s/series60_v21_c/epoc32 is the global environment variable% EPOCROOT%, and we use% EPOCROOT% when you say this path. 2. Build This directory stores an item file generated by Abld. 3. Symbian / 7.0s / series60_v21_c / examples / Basics / HelloWorld is your directory where your project is located. 4. HelloWorld / Wins is a HelloWorld project, Windows Simulator, if you are compiled for your mobile phone, you will be helloworld / thumb. Then a dialog box requests executable file when running. Enter% EPOCROOT% / Release / WINS / UDEB / EPOC.exe and then you will see familiar "Hello World" appears on the S60 emulator! Write here first, I hope that these texts have a little used. Next time I will introduce the basic type and code specification of Symbian OS [this blogger cannot handle anti-laminated lines, so I have to replace it with '/'! ] FAQ: 1. Various compilation issues, please make sure you have installed: Visual Studio 6, Active Perl, Series 60 SDK recommends VC, Series 60, and you write the code written in the same partition, you can save some of the troubles. Article Source: http://symbian.org.cn/bbs/viewtopic.php? T = 934

转载请注明原文地址:https://www.9cbs.com/read-38068.html

New Post(0)