Namespaces
Variants
Actions

Portal:KB Code Snippets

Jump to: navigation, search
Knowledge base identifier with text.png
Warning.png
Warning: This is not a protected Knowledge Base entry. Please treat it with caution.
All Articles | Code Snippets | Known Issues | Technical Solutions | Developer Contributed | Most Viewed | Translations | Help

All | Qt | Web | Java | Symbian C++


This page contains all official Code Snippets in the Nokia Developer Knowledge Base

Nokia Developer Code Snippets are easily reusable code blocks that perform a certain task or demonstrate an API use case. The example code has been created with the SDKs and been tested on real devices. Ideally each code snippet would contain a simple application that demonstrates the code in a practical way.

NEW! We have recently added a code snippets table that lists common mobile application use cases with links to corresponding code snippets. This way developers can now more easily find snippets in different programming languages and runtimes.

The Nokia Developer code snippets can be easily distinguished by a specific banner and the CS prefix in the title. Nokia Developer code snippets complement the existing Code Examples created by the developer community.


Comments

At Symbian Press, we've recently created a set of Carbide templates for our Quick Recipes book. We used the templates to make a wizard to create entire examples from the book's sample code. It allows developers to create fully personalised example code, and include their own copyright notice, project name and UIDs. Noticing this was a useful way of distributing example code, we've been trying to see where else it could work.

We saw on the Forum Nokia Wiki you have a collection of code snippets, and wondered if these would be a useful plugin to distribute as wizards to create the example code.The plugin would allow the user to click "File >New > Symbian OS C++ Class" and use the sub menu to generate code confirming to FN Wiki code snippets under the folder name "Forum Nokia Code Snippets". Our summer intern created a small example of what this plugin would be like which we can supply to you (uploaded here Media:KB code snippets templates 1.0.0.1.zip). Upon extracting it into your carbide plugins folder, it should just work.

We would like to hear your opinion on the plugin; improvements that could be made, considerations that should be taken, or simply whether or not it would be a practical idea. We know of several advantages: + The plugin povides the user with a quick and easy way of getting the code from your website to their project + The code can be personalised, app names changed, etc. + It allows users who need the same code over and over to have it at the ready in their Carbide workspace, so that they need not keep referring to the website

We also know of its weaknesses: - Some code is too small or too incomplete to warrant a whole class being created for it - From my own experience of programming, I've always thought that it was much easier to find example code on a website, copy and paste it into my project, and then work around trying to fit it in and personalise it. For code that was easy enough just to copy into a class here and there, the approach of following a wizard would seem to be making too much work for myself. - The Symbian C++ Class page will be full of templates that the user might never use.

It's totally up to you - if you want to take these over and extend them, and supply on the wiki or elsewhere for developers to download, you're very welcome.

Jo Stichbury, Symbian Press

 
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2012 All rights reserved