Symbian is an operating system that is an operating system that is divided by NOKAI's partnership, mainly for high-end smartphones. Its development language is C , you can use Microsoft Visual C 6.0 as an integrated development environment. It seems that although Symbian's goal is to be with Microsoft's Smartphone, it is not in touch with the means and methods, Microsoft is even secret. Who allowed the VC6 design to be open, and the result was taken by the enemy.
This article is just a introduction to Symbian's development, so it should be very simple, because after all, Symbian's development language is C , and it is not complicated because it is used for mobile phone operating systems. It is like many people. J2ME is also a Java language after all, and it will not be the same because it is used in the mobile phone. It can only be simpler. 5 hours is all the time I don't know if I don't know about Symbian. All the time on Symbian.
Because it is used for mobile phone operating systems, we study Symbian, first select a mobile phone and say. NOKAI's 60 series platform is a very good start. Nokai divides the mobile phone into multiple series according to the screen size and price of the mobile phone. The 60 series currently have two mobile phones: 7650 and 3650.60 series use Symbian OS 6.1, then According to the characteristics of the mobile phone screen, some modifications have been made, this modified Symbian is called the NOKIA's 60-series platform.
So the first step in the entry is to download S60's SDK, you can download from NOKAI's development forum: http://www.asia.forum.nokia.com/chinese/sch/main/series60.html. Looking at the latest NOKAI website is 1.0, but there is a 0.9 Chinese version below, so it is natural to download this 0.9 version. More than 100 megabytes, if you don't want it, you can have a CD with NOKAI, it is estimated that they should be very happy. This 0.9 Chinese version of the simulator is Chinese version, and there is a class that supports GBK and Unicode conversion, and I don't know if the English version of 1.0 is.
After downloading, it is installed, and selecting a directory is the same, but it is best to put it on the C drive. It may be considering the Windows platform and UNIX platform, this SDK is relatively mentally wisdom, I was installing the C drive at the time, and my own program put it into the D disk to generate a new project with VC6. There is a problem with the observation is the problem. Therefore, if the insurance is, it is best to put it on the C drive, interested in testing NOKAI. In addition, Java's runtime library and Perl are also taken, but the Perl of him has a problem with Perl, I downloaded a newest ActivePerL eventually installed. From the SDK installation, this is really less professional.
Just said, my Symbian installed the C drive, in the Symbian directory of the C disk, there is a 6.1 directory, two directories in the 6.1 directory: Series60 and Shared. Fortunately, you can see the general meaning from the name. Please pay attention to the EPOC32 / build directory under the Series60 directory, because this directory is used repeatedly.
The next task is to compile helloWorld and then run again. First, you have to confirm your system to install VC6 (it is best to install SP3 or more, otherwise you will be able to use the VC6 time to be alarm), and you have to put C: / Program Files / Microsoft Visual Studio / VC98 / BIN in your path, It is mainly used with nmake.exe. So if you have nmake, you can also look at HelloWorld without loading VC6. Find the directory of the HelloWord example, in me is C: /Symbian/6.1/series60/series60ex/helloworld/group. In Symbian, a Project is usually organized according to the catalog of Inc, SRC, Group, and the project file is usually placed in the group directory, so it is necessary to come here when compiling. Use the command prompt mode to enter the directory just said, then execute
BLDMAKE BLDFILES
This command will generate an abld.bat batch file in the group directory and generate C: /Symbian/6.1/series60/epoc32/build/symbian/6.1 under c: /symbian/6.1/series60/epoc32/build / Series60 / series60ex / helloworld / group This deep directory and generates a bunch of .make files in the bottom of the directory. I can't understand why I don't do it? Because they produce mobile phones?
Although it produces so many things, we don't want to manage, continue to enter
Abld build Wins UDEB
This command compiles our programs, and finally generates our HelloWorld in the c: /ssymbian/6.1/series60/epoc32/release/wins/udeb directory, then we can run the Debug version of the simulator from the start menu, open the Other directory You can run HelloWorld.
If you want to compile and run HelloWorld in VC6, run the abld makefile vc6 after running BLDMAKE BLDFILES, you will generate a VC6 DSW file, location in c: /symbian/6.1/series60/epoc32/build/symbian/6.1/series60 / Series60ex / helloworld / group / helloworld / wins. Look at Symbian so troublesome, it is not easy.
If you want to create a new project directly in VC6, you must copy the files under the C: /Symbian/6.1/series60/series60tools directory to the VC6 template directory.
Toss it here, you may have to spend more than 2 hours, and the rest of the two hours will look at the document.
Let's take a look at the HelloWorld's help documentation to understand the architecture of the Symbian program. The Symbian program is also organized by the document view structure according to the VC. There is an Application class CaknApplication. There is a document CaknDocument. There is a frame Caknappui, there is a view class CCoecontrol, etc., which seems to be almost like the VC structure, but feels its document The class seems to be made, I haven't seen this. Regarding the call relationship between these classes, there is a sequence diagram in the HelloWorld document very well, and I know it.
When watching Symbian's code, it is most uncomfortable to see the Pushl and POP functions, and there are many functions of L or LC suffixes. In fact, this is the exceptional process mechanism of Symbian. For example, we define a pointer to assign space, but the program suddenly appears in the program suddenly aborted when using it, and the address space occupied by this pointer is definitely not returned, and this is programmed on the PC. It may be no problem, so much memory, but it is not used for more time, but Symbian's designer may think that this is not on the phone, so many design is made. Symbian has a Clean Up Stack, when using the pointer, press PUSHL to press the pointer into the stack, then use the POP pop-up, if you can cause the crash in the middle, then the Clean Up Stack can Recycling the space occupied by calling the destructor of the pointer. These may result in a function of crash in Symbian as a possible Leave function, so a L is added at the end of these functions. The function of the LC suffix indicates that the function has been pressed into the Clean Up Stack internally, and there is no need to use PUSHL when calling, and directly calls the complete POP. The Clean Up Stack also provides a popanddestroy function, which is to pop up the stack and then destroy the pointer. By the way, the official is formally because of the Clean Up Stack mechanism, Symbian seems to be less than the VC program, for example, many types of constructor are constructed, and the operator is assigned when the address is distributed. New () has also become New (Eleave). The above can take a look at the memory management section in the Symbian programming basis. Symbian defines a bunch of data types, if you don't want to find trouble, or use these types of these types. Simply put, the integer has Tint and Tuint, which is divided into 8-bit, 16-bit and 32-bit, such as Tint8, Tint16, Tint32; text type is TTEXT, which is ttext8 and ttext16, but inside It is Unicode, so internal reference should be TTEXT16; BOOL type is TBOOL, the corresponding value is Etrue and Efalse; floating point is TREAL, but it is divided into TREAL32 and TREAL64; there is a reference type TrefbyValue
Because Symbian is a more object-oriented design, this change is relatively large in our common string, called Descriptor in Symbian. The bottom is two abstract TDESC and TDES. In fact, TDES is also inherited TDESC, and C letters in TDESC are constant constant meaning. That is, it is a defined constant, which cannot be modified, without c, which can be modified, and the same is the same below. The pointer descriptor is TPTRC and TPTR, similar to the char * in C ; buffer descriptor is TBUFC and TBUF, similar to char []; heap descriptor is HBUFC, similar to (char *) malloc (Length 1) usage. In particular, the above type is divided into 8 bits and 16 bits. for example:
TBUF <64> BUF; Ceikonenv :: Static () -> ReadResource (buf, r_example_view_title);
A buffer with a maximum length of 64 is defined first, and then read the resource named r_example_view_title. Another example:
Ttext8 * Str = (Ttext8 *) "Demonstration window title"; TPTRC8 Source (STR); Iinfotext = Hbufc :: newl (Source.Length ()); tptr16 ptr = Iinfotext-> des ();
Define an 8-bit string STR, then construct a pointer constant source, define a 16-bit pointer according to the Source length, and the next step is not written here, but it should be converted to Unicode for GBK.
Symbian's resource files are generally named by RSS, without dedicated resource file editing, users must use Notepad to open the RSS file manually to write RSS files. This has certain rules and methods, and the reference example is not difficult to write your own resource files. It should be noted that if there is Chinese in the resource file, you must save the file as a UTF-8 format.
It is relatively simple to get started, but it takes a lot of practice.