A blog about everything that sounds interesting to me and Forum Nokia audience.
dcrocha | 11 June, 2008 17:52
I was preparing demos for the next Forum Nokia Tech Days, to be held in São Paulo, Brazil next week, and it came to mind I should do something with the sensors using Python.
Here is the result: Sensor-powered music player for Nokia N95. Nothing too sophisticated, but it goes to show how you can showcase your ideas pretty quickly using PyS60: it took me about 2 hours to develop.
dcrocha | 03 June, 2008 18:49
The comic above pretty much sums it up: Python is a refreshing look at the world of programming. Being so easy to learn and use, it has gained lots of attention from the developer community and it's used for several different purposes such as: web development, desktop apps, utilities, scientific computing, scripting language for games and special effects software, flying and of course mobile development. In fact, I am very surprised that it took so long before any mobile platform offered Python as a viable software creation vehicle.
In our platforms, Python is offered as a runtime option for S60 devices, ranging from 2nd. to 3rd Edition and all their feature packs. That makes it pretty wide reaching platform, since we have some 130 million+ devices in the market for which you can write Python applications.
The core technologies for mobile development have been analyzed here before: C++ is the raw power of Symbian OS available to developers, with its immense API and functionality sets but steep learning curve; Java is easy to learn and use and it's present in more than a billion devices. Its functionality is good but restricted by the Java Community Process since all APIs have to be agreeded upon by participants of each JSR spec.
Python comes in the middle, and that's in my view its main advantage: it is as easy as Java but (almost) as powerful as C++, and not limited by any industry standard processes: you want a Flying API which is not available? Just create an extension and you're good to go. Our good friend and Forum Nokia Champion Pankaj Nathani (a.k.a. croozeus) has in his website a great list of resources for Python development, including how-to's on writing extensions and more: http://croozeus.googlepages.com/py60extensions. Also, if you are the kind of developer who likes to hack around, Python for S60 runtime is open source, so you can spend your days and nights hunting bugs, adding new features and creating your own version of it!
First part of this article: Which technology should I use for development? Round 1: Java
Second part of this article: Which technology should I use for development? Round 2: C++
Technology: Python for S60
Good for:
Why?
Bad for:
Why?
Python brings back the fun of hacking your device the way you want, with just a few lines of code. It's also a powerful tool for fast development of applications and utilities, besides being ideal for rapid prototyping of more complex software. The learning curve is smooth, the API set is big, and the support of open source community gives it a large set of libraries you can use in your application. As it's still in an incipient phase in the mobile software development, you can use it and contribute for its evolution in the next releases, making it a sweet platform for innovation on S60.
If you are interested in learning more, there's a ton of resources on PyS60 in Forum Nokia web site and also in its wiki page. For impatient people who can't wait to try it, I have posted a few months back a complete presentation on how to get started with Python, along with a collection of sample source code; both can be found here.
Happy hacking!
<a href="http://technorati.com/claim/ymg32hejh6" rel="me">Technorati Profile</a>
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:
Why?
Bad for:
Why?
"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!
dcrocha | 27 May, 2008 18:29
If I had just made a dollar each time I heard this question... *sigh*.
With the availability of so many different development technologies in Nokia's platforms today, sometimes is hard to decide which of them we should use to build our application, isn't it? There's Java, Symbian C++, Open C, Flash Lite, WidSets, WRT Widgets, Python, and the list is still growing.
This is good news for developers, since not everybody has the same technical background nor is developing the same kinds of applications; this means at least one of the technologies will fit our experience and purpose like a glove, and we are going to use it. On the other side, this may confuse newcomers to the wonderful but fragmented mobile software world. Usually it goes like this:
Question: "I want to write an application that opens a file and sends it out to a web server. What should I use to create it?"
Answer 1: "Java ME, FileConnection API"
Answer 2: "Don't bother, use C++ or you will get a lot of security prompts."
Answer 3: "Why use C++ when you can do the same with Python? C++ is way too hard!"
Answer 4: "Python does not run on S40, use Java."
Answer 5: "Do you really need all that jazz? Why don't you go with Flash Lite and use server-based persistence? Your application will look great!"
Answer 6: "Flash Lite is too fragmented. Use Java, but beware of the MIDlet signing issues or your app's user experience will be crap!"
Go check the Discussion Boards. It is crowded with examples of conversations like the one above. Having answered this question so many times before, I decided to summarize my answers in this blog, in the hopes of helping developers decide what use from the growing technology options pool offered in mobile devices these days. Please keep in mind that the following are my opinions on the subject; yours may differ and even prove mine wrong, but that's the beauty of interacting with people within a community. As the number of technologies it too big for a single post, I will continue my analysis in the upcoming posts. I will start off with the most popular mobile developmentp platform, Java ME.
Technology: Java
Good for:
Why?
Bad for:
Why?
Next time I will cover the darling of all Internet programmers, now getting much of the attention on S60 platform: Python.
See you!
dcrocha | 14 May, 2008 22:23
Sexy UIs are all the rage today, right? FlashLite apps, WRT Widgets, WidSets, all of them have distinctive user experiences which differ greatly from the way we interact with native S40 and S60 applications. More colors, more animations, better usability, all making up a great way for developers to differentiate their applications and make them more attractive to the end user.
In Java MIDlets however, you are stuck with a very poor UI toolkit, the LCDUI, which has very few components and few options on how to alter their appearance; most of the time you're giving hints to the underlying implementation regarding the way you want the components to be displayed. Even if you do so, however, there's still a big chance your hints will be ignored and the UI will be rendered differently on each device. This can be a pain if you are developing for many different phones, with different screen sizes, input methods and form factors. Actually, to be fair, this can be a pain even if your target is a single device.
To circumvent these challenges, developers had either to developer their own UI toolkits, based on raw Canvasses, or use a 3rd. party toolkit such as J2ME Polish, which is great but requires a paid license to develop commercial applications, and this can be an unbearable cost to a small developer.
Searching the web and some mailing lists, I found this very interesting project, called LTWUI (Lightweight UI Toolkit), which is a cross-device UI toolkit created to provide developers with the possibility of developing compelling user interfaces without writing painful low-level Canvas code. It's based on Swing programming paradigm and it's key functionalities are:

LWTUI demo midlet running on E61i
It's still in Early Access release but you can go to the project page and download it so you can play around with the toolkit and run its demos on emulators and real devices. The great thing is that the library is released under the Sun Licensing Agreement (SLA) which makes it usable by commercial applications without having to pay any fee.
I ran the LWTUIDemo midlet on my Nokia E61i and N95 and it worked beautifully. It's a bit slow though, but nothing that compromises the user experience. I recorded a video of LWTUI running on my N95, so you can see what's up for use in your Java apps; I guarantee you will enjoy it.
Last but not least, the project is open source, so you can contribute to it, just go to the project page for more details on how to participate.
Here's the video, enjoy it:
[]s
Daniel
dcrocha | 11 April, 2008 16:36
Pretty interesting document posted by Aleksi Uotila on the S60 Java blog, containing a PDF document about S60 3.2's eSWT plug-in for Java applications. I have been using this toolkit's desktop version for years and I must say I have never looked back to Swing or AWT, so I really hope there's more development on this side for mobile devices, since innovation on Java platform has been a bit slow these days, partly due to the JCP process and everything.
Here are some screenshots of how eSWT apps look like:
Direct link to the article here.
******************************************
After Carbide.j's demise, I have been working hard to get used to the other toolsets in the market. Adaptation to NetBeans Mobility Pack was pretty swift, but I can't say the same about EclipseME, since I had many conflicts with my version of Eclipse, but thanks to Leisti's article on Wikipedia I finally got what works with what then my setup is now running smoothly, and I'm a big fan of C-like macro preprocessing, which helps a lot in reducing the problems of device fragmentation. EclipseME, as well as NetBeans, have this feature and I love it, specially when dealing with "new" APIs not available across S40 and S60 (Location API, do you hear me?) and also with the (too) highly modular Mobile Media API.
<code>
// #ifdef DEBUG
System.out.println("Some debug output");
// #endif
...
</code>
******************************************
Speaking of fragmentation, the other day I was checking my GMail account and I came across an ad for Tira Jump 2008. For those who don't know it, Jump is a tool to facilitate application deployment across mobile devices, so you don't have to do it manually. I saw a presentation by these guys at JavaOne 2005 and was pretty impressed when they created a MIDlet game which could run on 120 devices almost automatically. Today they claim support to 1200 device models, which is quite a number! They have a free version of the tool that you can use to test the product and deploy your midlet in up to 12 different models. I'll give it a try later.
******************************************
Why so much JAVA? I'm writing some chapters of an upcoming Java book for a well-known editor, so I have been thinking in Java instead of Portuguese for the past two weeks, and it's been fun.
Speaking of Portuguese, my native language, the "hot java" joke never made any sense to us, since we don't call our coffee "Java", but I nevertheless inserted throughout the post just to please our English-speaking readers :)
dcrocha | 02 April, 2008 14:18
I have tested it as promised in my last post. After some initial trouble, I managed to get the Symbian 9.2 Platform Security hack working on my N95 with 20.0.015 firmware. It does work, as long as you don’t reboot the phone, as you can see in the screenshots I have posted on my personal blog, rawsocket dot org, where you can also find more details on this issue.
The trick is still a bit cumbersome to perform, but it works. I'll keep my eye on the latest developments from both sides, hackers' and Nokia's, to see where this is going. Are we seeing the beginning of a catch-up game like the one Sony and Apple have been playing against hackers, with all the jailbreaks and cracked firmwares?
dcrocha | 27 March, 2008 16:49
At least that's what says this story run by Engadget Mobile:
App certificates have long been a bane to S60 users and developers alike, causing pain, frustration, and an almost obligatory cash outlay to get your hard work certified to run on the very platform Nokia is so quick to call "open." Finally, it truly is, thanks to the hard work of the Symbian hacking community that has developed an easy (or easy sounding, anyway) method of "jailbreaking" the Symbian 9.2 device in your life (S60 3rd Edition FP1 users, that's you). After that, installed apps won't need a certificate at all -- let alone an invalid one -- to do their dirty work. Open, indeed.
It points you to this site where instructios are given to unlock a single phone using AppTRK and a couple of Python scripts. The hack isn't permanent, which means after a reboot your device gets back to normal. They say they're working on a permanent hack, which would allow iPhone-style jailbroken firmwares running unsigned applications at full capabilities.
I haven't tested it myself, but it seems it works at least on Feature Pack 1 devices. I will test with my N95 with an application which requires all capabilities (including manufacturer-given) to see what happens.
Anyway, I would advise nobody to do it to their own devices, since this opens up the possibility of you installing apps whose authors you don't know and can do real damage to your phone if they are making use of sensitive capabilities whose use is protected by the whole signing scheme.
dcrocha | 24 March, 2008 19:09
As I mentioned in my last post, I have been thinking a lot lately about how to extend applications that run on sandboxed environments, such as Java ME, Flash Lite and Widgets, using some powerful native technologies such as C++, Python and Mobile Web Server.
I did my research and turns out some people have already been thinking (and doing) this for a while now, so I wanted to share this with you, for a reason I will explain later:
- Our very own Sr. Technology Expert Petro Soininen has created a widget that's able to send text messages and read the SMS inbox of an S60 device, using a creative combination of Widgets, Python, PHP and the Mobile Web Server. Here's the link for the article with complete source code: http://wiki.forum.nokia.com/index.php/How_to_utilize_device_resources_from_a_WRT_widget
- Forum Nokia Champion Felipe Andrade and his company have been working for quite some time in the Flyer Framework, a server application written in Python for S60 whose goal is to provide enhanced native functions to Flash Lite applications. It looks pretty mature, and I wonder if it could be used with Widgets as well with some adjusts in connectivity (full HTTP vs XML sockets).
I mentioned these two ways of extending widgets and Flash Lite apps because of the Global Code Camp Contest. I figured that an application/widget with enhanced functionality has more room for being innovative and delight users in many different ways.
As nothing was mentioned in the contest rules, I asked the Forum Nokia team responsible for the competition whether applications produced with these extension methods would be valid or not. An the answer is that these turbo web widgets and Flash apps are allowed, so you have a lot more options to introduce cool features in your apps via sweet Python and PHP scripts.
So take a look at them both and make your widgets and Flash apps fly higher than ever!
dcrocha | 20 March, 2008 17:43
If you have been reading Forum Nokia web site regularly, you've probably noticed the big Win 15k Euros! posted on the main page since March 18th. If you click the link, you'll be redirected to the Forum Nokia Code Camp Competion we're hosting. It's all about you developing a winning Web Run-Time (WRT) or Flash Lite application and raking in a lot of nice prizes from Forum Nokia.
Registration has already begun, so come up with your bright idea for either platform and enter the competition!
If you have a concept but don't have a command in any of these technologies, a good idea would be to register for one of the Forum Nokia Regional Code Camps happening worldwide and get started with both WRT and Flash in nice hands-on workshops.
Yours truly will be probaly hosting a Flash Lite somewhere in April, stay tuned.
If you're more into widgets, you can also get started by checking out this article I wrote back in November 07. It covers everything you need to know to develop your first widget, including SDK and live testing with our Remote Device Access service:
* * *
I have been thinking a lot about Python for S60, Mobile Web Server and how to extend Flash and Java applications using the former technologies. I wonder if it would be possible to extend Widgets as well, having a C++ or Python light web server running on the phone while a widget makes local XMLHttpRequest connections to this service, thus getting more native-related functionality. Mobile Web Server seems like a good candidate for this type of experimentation. I may give it a try soon. (evil laugh)
dcrocha | 19 March, 2008 13:37
Hello all,
This is my first post at Forum Nokia's Blogs, and certainly won't be the last since I like to talk a lot.
I have been working with Forum Nokia since 2005 and with Nokia technologies since 2000, and it's been a pleasant journey I can say. I am based in Sao Paulo, Brazil, where we Forum Nokians have the mission of building awareness for Nokia technologies and platforms and of course help the developer community (which is huge) grow interest in mobile software development.
As one of the lucky people (according to Hartti) to attend BOSSA 08 Mobile Open Source Software conference held in Recife, Brazil. I gave a lengthy workshop on everything you need to know to get started with Python for S60 application development. I had a lot of fun preparing the workshop, since until 2 weeks ago I knew very little about the technology, and after reading all of the project's material and the amazing Mobile Python book from Forum Nokia Champion Jürgen Scheible, I became sort of an expert on it (at least compared to myself in the beginning of March). It always nice when you can have the opportunity of learning something new, specially when it makes your life so easy as Python for S60 does.
For those interested on it, the material I've presented is linked below so it's free for you to download and enjoy. It contains a .ppt presentation about all things PyS60 (from downloading to start developing and running apps on the phone) and some source code examples, many of them written by my, others taken from the book cited above.
Here are the links:
python_pres.pdf (pdf document containing the presentation)
python.zip (source code)
Of course, your feedback is always appreciated!
[]s
Daniel
I'm a software engineer with 10 years experience in application development, having worked with Web (Perl, PHP, JavaScript, JSP, Servlets, Flash, ASP), Enterprise (Java EE) and Mobile software (Symbian C++, Java ME, Flash Lite, Python). Currently working as Forum Nokia Technology Expert with many exciting technologies.
Check my blog for more articles and funny stuff: http://rawsocket.org