3650 Symbian system is an operating system developed by NOKAI's partnership 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 primarily for Symbian development, so it should be very simple, because after all, Symbian's development language is C , which is not complicated because it is used for mobile phone operating systems, just a lot of people have been hanging in mouth. The J2ME is also a Java language after all, and it will not be the same because it is used on the phone.
Because it is used for mobile phone operating systems, we study Symbian, studying NOKIA's 60-series platform is a very good choice, and NOKIA divides mobile phone according to the screen size and price of mobile phone into multiple series, and the 60 series is currently two. The mobile phone: 7650 and 3650.60 series use Symbian OS 6.1, then make some modifications to the UI according to the characteristics of the mobile phone screen, this modified Symbian is called the NOKIA's 60-series platform. So the next content is also useful to 7650.
The first step to get started is to download S60's SDK, you can download from Nokia's development forum: http://www.asia.forum.nokia.com/chinese/sch/main/series60.html.
Looking at the latest in the Nokia website is 1.0, but there is a 0.9 Chinese version below, so it is natural to download this version 0.9. More than 100 megabytes, if you don't want it, you can have a CD with Nokia, and 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.
Download is installed, choose a directory, but it is best to put on the C drive. It may be considering that the Windows platform and UNIX platform can be used, this SDK is relatively mentally wisdom when processing the drive letter and the directory, I at the time of the SDK to the C drive, my own program puts the D disk with VC6 to generate new projects. Question, observed is the problem of disk. Therefore, if the insurance is, it is best to put it on the C drive, interested in testing the Nokia. 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 helps the software to engage in mobile phone seems to be not professional, huh, huh.
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 here is C: /Symbian/6.1/series60/series60ex/helloWorld/groupsymbian, a project is usually organized by catalogs such as Inc, SRC, Group, and the group directory is usually the project file. So you should come here when compiling. Use the command prompt mode to enter the directory you just said, then execute the BLDMAKE BLDFILES, which will generate an abld.bat batch file in the group directory, and will under C: /Symbian/6.1/series60/epoc32/build Generate c: /ssymbian/6.1/series60/epoc32/build/symbian/6.1/series60/series60ex/HelloWorld/group This deep directory and generates a bunch of.make files in the bottom directory. (I can't understand why it is so doing? Is it because they produce mobile phones?) Although it produces so many things, we don't want to enter the abld build wins udeb this command compiles our program, and finally in C: / Symbian / 6.1 / series60 / epoc32 / release / wins / udeb directory generated our HelloWorld, then we can run the emulator from the Start menu to 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 next time looks 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 has Etrue and Efalse; floating point is TREAL, but is divided into TREAL32 and TREAL64; there is a reference type TrefByvalue
It is provided in the form of a template class.
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.
I have long wanted to write such an article, but I have never been aware that the main content of this article is an article from Said.com, because some of the ambitions have been interested in 3650's deep research, so. Article, is a little time to save my time. It should be noted: This is just a simple entry introduction, what should be counted for friends programming with C . For beginners, C features are very powerful, but it is quite complicated, the process is very boring, so it is still necessary to resistivity and time.
In addition, many friends around you are more interested in Java, including some professional programmers, also like to develop Java applications, I also interested in this area, and I have the opportunity to organize some questions about Java programming. Aspects of content.