A blog about everything that sounds interesting to me and Forum Nokia audience.
dcrocha | 30 May, 2008 15:39
The Holy Grail, according to Monty Python
So let us talk now about the Holy Grail of mobile development in Nokia platforms: Symbian/S60 C++. It is the language in which the operating system is developed (about 95%), it is the language that allows developing all sorts of applications, from simple expense trackers to VoIP and geotagging and video-sharing applications. It is the language about which odes are written, flowers strewn at is feet, and virgins sacrificed to its altar.
It is also one of the hardest development environments there is to learn: it's not standard C++, you have to instrument a lot of the memory management yourself, the learning curve is very steep, and the amount of code it takes to write even a simple "Hello World" GUI application is larger than any other technology we'll talk about. However, if you have the skills to learn it, the patience to develop apps with it, and want to power your application with the most sophisticated features available, it can be a very rewarding experience using it after all.
Obs.: I know I promised Python this time but I felt like covering the two core technologies first.
First part of this article: Which technology should I use for development? Round 1: Java
Technology: Symbian/S60 C++
Good for:
- Games - Full-fledged commercial complex games, such as N-Gage's, as the APIs for direct screen access, 3D graphics, audio and video and camera manipulations are very powerful and enrich and gaming experience.
- Multimedia applications - You can write very complex applications which integrate a handful of different powerful features such as: location, geo-tagging, video and audio low-level manipulation, VoIP, camera access and so on. As examples, check Shozu, Fring, Windows Live, Google Search, and many others.
- Mapping and location apps - These leverage the powerful Location APIs along with the OS-provided Assisted GPS and the Map and Navigation framework (3.2 only) to give you a very fine-grained control over obtaining the location of your device and integrating it with other features or APIs. For example, Shozu integrates GPS location with EXIF JPEG data manipulation to upload pictures which are geotagged to known services such as Flickr, where they are placed automatically on a map. Very creative. Check also WayFinder, Google Maps, Nokia Maps, Route 66.
- VoIP Applications - There are simply too many to list, just check for yourself.
- E-mail applications - Your e-mail apps can talk to Microsoft Exchange using ActiveSync protocol, and also be integrated into the standard Messaging application so users can access it without having to go to the menu.
- Many others - Enablers, virtual machines, services, device drivers, file managers, are all examples of sophisticated applications which can be written in C++.
Why?
- API/functionality availability - Programming with Symbian C++ is almost like programming desktop applications: you will get a stagerring number of APIs, powerful features, sophisticated integration between applications and services; those allow you to do more with your device than any other technology.
- Performance - Native C++ applications have the best performance of all analyzed technologies (unless you're a really really bad programmer).
- Porting from other platforms - This used to be a nightmare, but with the introduction of Open C and Open C++ porting layers, it became much easier to port from other POSIX platforms.
- Tools - Although the building tools themselves are not standard, Carbide.c++ does a fine job of hiding the complexity from you the programmer, allowing for faster application development. Its debugging tools are specially worth mentioning.
Bad for:
- Simple applications - If you need to develop an expense or sports tracker, a blogging tool, casual game or such, using C++ is probably an overkill. You can achieve the same in much less time using Java, Flash Lite or Python.
- Rapid prototyping - Symbian C++'s complexity will add much more time to your development projects, so it's not well suited for protopying. Do it in Python or Java and if needed, write the final version in C++.
- Casual games - That would be another overkill. You will end up writing 7000 lines of code or so per game, and your productivity when compared to your competitors using lighter technologies will suffer. A lot.
- Web applications - At risk of souding repetitive, another case where you're better off with technologies whose focus is Web services. I'm talking Widgets, Widsets and Python here.
Why?
- Harder to learn than any other technology - Even an experienced
programmer, coming from other C/C++
languages, will have a hard time learning Symbian C++, using the
non-standard tools and proprietary features, such as resource and
registration files. It can take a long time to get a decent working
knowledge of how everything
works and even then you will find yourself.
- Slower development time - Due to the steep learning curver and overall complexity, native development in S60 is generally though to take 3 to 10 times more time than Java or Flash Lite projects.
- Portability - First off, there's a binary compatibility break between S60 3rd. Edition and its previous editions. Secondly, even within the same versions there some API incompatibilities/deprecations you'll only find out about when you're deep into development. In this case you'll have to produce a workaround or ask technical support from Forum Nokia to fix you an update, workaround or private API that does the job.
- Platform security - Although it's very noble on its purpose (securing users' devices against malware), platform security can be a pain to live with during the development cycle. The whole Symbian Signed environment and platform security API restrictions slow down development time and can increase development costs, because of test fees, certificate purchasing, re-test, etc.
"With great power, comes great responsibility", once said Spider-Man's uncle. In this case, however, with great power you'll get great complexity. If after careful evaluation of requirements you decide you should go with C++, commit yourself and your development team to learn the plaform right, and well. Otherwise it will cost you time and money. We know that time = money, so it will end up costing you money².
Symbian/S60 C++ offers you the opportunity of leveraging as much functionality as the device can provide. This can be a real differentiation factor for your applications and can result in more users, thus more money. Just make sure it's the right technology for you before you start up your project.
OK, now I'm not lying: next round will be about Python.
See you!