Contact Us

If you are interested in our services leave your contact details below and our sales representatives will contact you.

The organization which you represent
Email address we will use to contact you
Longer contact form…
 
  • About

    mFabrik Blog is about mobile and web software development, open source and Linux. We tell exciting tales where business, technology, web and mobile convergence.

    Creative Commons License
    This work is licensed under a Creative Commons Attribution 3.0 Unported License.

Python 2.3, Python for Series 60 1.4.5 still in use… and insight into Symbian deployment process and user experience



Nokia’s Python for Series 60 has a long history. It is a Python interpreter, originally escaped from Nokia prototype labs, running in your phone. It is said to been awesome to show mobile/embedded developers, who were love with their static C compilers and 4 hours built times, opening a Python prompt in your phone and typing import audio; audio.say(“your phone loves Python”) by keypad (Nokia Series 60 phones come with a speech synthetizer). Python for Series 60 is the best tool of building a simple proof of concept mobile applications. The lack of speed, lack of good UI libraries and difficult deployment problems makes it challenging to use it in production grade environments.

PyS60 has also a history of staying in archaid Python version – namely Python 2.3. It was not until this February when stable PyS60 2.0.0 with Python 2.5 was released (1.9.x was considered experimental according to the release notes). Luckily looks like new winds are blowing (Qt acquisition, Meego/Maemo) and Python is getting higher priority. For example, PySide Qt bindings is very high profile project. Based on this, we hope to expect Python to the first class citizen in the future Meego and Symbian devices.

My company had a little side venture with PyS60 Community Edition when we were still betting that Symbian and Python would rock the world – the era before iPhone changed the game.  PyS60 community edition was effectively a revamped PyS60 1.4.x with Python 2.3 toolchain which actually made PyS60 application production deployment possible. Possible…? -you ask. Madness… no. It is Symbian. It is certification and signing and obscure error messages. Basically vanilla PyS60 is being shipped as an external SIS (Symbian package format) and Symbian platform security makes it impossible to deploy two production signed applications using vanilla PyS60 on the same device. The only cure was statically building Python for both apps from the scratch, which is exactly what PyS60 Community Edition was doing.

But this all was long long time ago. Aeons in mobile time. So I was today surprised when I got email from a person (David) using PyS60 Community Edition. We never upgraded PyS60 Community Edition to Python 2.5 . In fact we haven’t touched the project about two years. David was effectively using Python 2.3 and asked questions about the tool chain internals.

My first answer was a question Why on Earth you are still using Python 2.3? I thought maybe the guy had somehow missed the last two years or was a stuck with an old phone.

However… this was not the case and the answer was very insigtful.

Yes, I’m aware of PyS60 2.0.0, but I prefer PythonCommunity, at least for the moment: no OpenC neither Platform Services dependencies; smaller .SIS size and memory footprint. I think that the final .SIS produced with PythonCommunity, with everything necessary to run contained in it and with a clean installation without multiple dependencies, is a better fit for a mass-market than the files produced by PyS60 2.0.0, above all taking into account that people don’t know what S60 or Symbian are.

Also, the runtime deployment on the new PyS60 isn’t automatic for S60_3rd and S60_FP1 devices, so in the worst case scenario, users may end having to learn to install the different files (pips.sis, ssl.sis, stdioserver.sis, Python_2.0.0.sis, PythonScriptShell_2.0.0.sis) in the correct order, which is a big no-no for a mass-market deployment.

So…. I hope someone in Nokia is reading this blog entry carefully. Do it like Apple does. Make your application deployment static. Make OpenC static. Make every freaking library which is not shipped with the device statically buildable. It should be possible now when everything is open source. It will consume precious device RAM, but at least it will make mass market application development possible. SIS hell is worse hell than deb hell, or DLL hell, as the end user cannot fix it due to device security.

In the related news SIS smart installer was announced few weeks ago. Personally I wouldn’t bet it can deal with all the problems of versioning and Symbian platform security. Forum reports aren’t promising and looks like very Symbianish user experience can be expected. In positive light, it seems that Python is being considered for this process.

Read our blog  Subscribe mFabrik blog in a reader Follow us on Twitter Mikko Ohtamaa on LinkedIn

CodeSign error: a valid provisioning profile is required problem in XCode



The above error pop-ups when you try to build iPhone application for the device. It means that the provision name in XCode project settings does not match .provision file installed in XCode Organizer (device manager). Usually this happens when you have downloaded XCode project created by someone else.

It should be possible just to go to XCode -> Project -> Project settings and chose a valid code signing profile (Code signing -> Code signing identity drop down should have been populated from the choices available in XCode organizer). However, it seems that there is a bug and always changing this setting does not have effect. Based on reports, it looks XCode project setting updater is confused about something and does not update the setting correctly.

The hardcode workaround is to edit your XCode project .xcodeproj file manually. You do not need to close down XCode for this (it will automatically ask to reload after the file is saved). You may see duplicate entries of  XCBuildConfiguration. You need to hunt down one with old (incorrect) values and manually copy-paste in correct values. You can get the correct values from XCode organizer.

For example, I had to edit in :

	CODE_SIGN_IDENTITY = "iPhone Developer: Mikko Ohtamaa (XXXYYY)";
	"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Mikko Ohtamaa (XXXXYYY)";
...
                PROVISIONING_PROFILE = "7572BAC6-4F0C-46D3-B96F-XXXXXYYY";
	"PROVISIONING_PROFILE[sdk=iphoneos*]" = "7572BAC6-4F0C-46D3-B96F-XXXXXYYYY";

manually to the file, replacing the old values for these settings. Note that values may be in many lines.

Hope this helps someone.

Read our blog  Subscribe mFabrik blog in a reader Follow us on Twitter Mikko Ohtamaa on LinkedIn

Looking for free icons?



Check out this Smashing Magazine article with 50 free icons set.

Then there is 14 free mobile application icon set by Speckyboy design magazine.

Ps. Please if you have any good free icon set tips share them in the comments

Read our blog  Subscribe mFabrik blog in a reader Follow us on Twitter Mikko Ohtamaa on LinkedIn

Why C# / Javascript will be allowed and Flash won’t be as App Store programming language



All the Flash developers of the world wet their pants on 8th April 2010 when Apple announced that Flash based application won’t be approved in the Apple’s App Store. This essentially destroyed the easy opportunity to monetize existing Flash development skills and the huge Adobe expansion potential into mobile markets, pissing a lot of folks who had bet on Adobe’s technology, leading developers’ rage on Internet forums.  Bad news for those who had already building iPhone apps on Flash CS5 even before it was released…

Unfortunately it was not only Adobe and Flash who got in the line of fire: popular frameworks like Appcelerator, Unity 3D and Monotouch apps are theoretically excluded to enter App Store by the new developer agreement which states that the original source code of the application must be C, C++, Objective-C or WebKit/Javascript.

I belive Apple does not hate certain programming languages. Apple does not either want to force you to use their development tools. Only by understanding what Apple really meant with the infamous 3.3.1  clause in the developer agreement, we can start building a bridge to get MonoTouch et. al. to be Apple’s favorites again.

History of Flash (Lite)

Adobe (Macromedia) and Flash have been into mobile business far before iPhone was published. The thing is called Flash Lite run-time. It runs on billions of phones.

The problem of Flash Lite is that it does not very well integrate with its host environment. It does not even have so simple user interface component as a “menu” out of the box. Which means that every developer must create their own menu implementation. Which means that there exist hundreds of shitty Flash Lite menu implementations out there, each behaving differently and each not resembling the native menu component. This is not a very nice thing if you consider the user experience of the application and iPhone  is all about user experience. Note that this is not so big thing for games, as games have radically different user experience anyway.

Flash does not communicate with its host platform either. You wouldn’t be able to access native API features even if you fully controlled the deployment environment of Flash application, as Flash is a binary blob into which you cannot plug-in more parts. There even exists a product for mobile Flash whose sole purpose is circumvent the limitations of  Flash by using a localhost TCP/IP socket connection and a native server application. If developers choose Flash they choose to lock themselves into Flash and what Adobe gives for them.

This crippling of your platform potential with Flash is not limited to Flash Lite and mobile. I have personal experiences from a project done with Adobe Air for Windows. We wisely chose Adobe Air as a desktop application development platform, because it would guarantee the future portability of our code. However, this nice idea did not really interest in the point when we noticed that we e.g. couldn’t control how File Open dialogs behave (file mask, remember start folder, etc.), severely reducing the user experience of the application.

So, Steve Jobs definitely is on something when he says “intermediary translation or compatibility layer” is bad for your platform.

Note that the same limitation concerns Java ME also. Desktop Java has JNI interface for building extensions, but mobile Java doesn’t.

How other frameworks differ from Flash

Let’s take a MonoTouch for example. MonoTouch is Novell’s open source Mono project based development tool which allows you to create iPhone applications in C# language. Compared to Objective C, development using MonoTouch  has several advantages for certain audience: you don’t need to learn new programming language, C# is closer to traditional Java/C++ languages than Objective-C, you can leverage the full potential of existing C# ecosystem out there, the standard library has more functionality and of course, it is easier to port the core of the application from a platform to another.

Note that the porting part concerns core i.e. application logic only. MonoTouch does not try to separate you from Apple’s platform. It does not reinvent platform services or user interface building blocks, or force something like Windows user interface into your shiny iPhone. In fact, MonoTouch seamlessly integrates with Apple’s platform. You even need to use Apple’s own Interface Builder tool to create user interfaces, which will be exposed to MonoTouch’s C# code. Binding with native API is breeze: below ten lines of code guaranteeing that whenever Apple releases a new platform feature it will be instantly available for all MonoTouch developers.

MonoTouch embraces the platform. You can pick Objective C or C# depending on taste. The resulting source code is similar in idea, different in syntax. There is no “compatibility layer” so to say. Not even technically, as C# is compiled to native ARM binary. There is no way how a person could distinguish a MonoTouch application from an application build using Objective-C.

Open source philosophy and platforms

Appcelerator, PhoneGap and other open source / Javascript frameworks are also protected from Apple’s wrath. They are open source which means that you can tap the full potential Apple’s development platform as long as someones writes a little binding code. Also, they try to use native look and feel and components as much as possible, just to make the applications slick. The frameworks do not have conflicting interest with Apple; the frameworks provide portability to a certain point, but they do this respecting their master.

Flash does not enjoy this freedom; developers can’t change Flash or venture outside Flash’s sandbox.

The Future

There is no point of technically counter App Store’s developer agreement, like saying “hey I’ll just compile all my Flash source code to C so it is C code.” It’s Apple’s game. Apple can do anything they wish and they can also change the developer agreement. So when Apple sees something happening in its ecosystem which might damage it, it simply pulls the rug under your feet again. But Apple can also change the agreement in a positive way. PhoneGap has already went through process of becoming App Store approved framework once. I hope that development communities will not burn its bridges with Apple, but try to communicate this matter with a meaningful manner and come to a development agreement resolution based on ideas given in this blog post. Below is my proposition (IANAL. It is left to the reader to come up with something smarter):

3.3.1 — Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be written using Apple’s guidelines and best practices to express Apple’s intend how the application should behave.

iPhone is not a monopoly. You are free to build and run your Flash application on a device like N900 on any day and sell it in Nokia’s OVI store. If this is a problem for your business then maybe you should reconsider your business model to be less iPhone centric and promote heterogenicity of mobile platforms and application stores.

Until Flash is fixed so that you can mix-in native code, instead of it being a barrier between the expression and the hosting platform, I find it unlikely any company based their reputation around the user experience would allow Flash on their platform.

Read our blog  Subscribe mFabrik blog in a reader Follow us on Twitter Mikko Ohtamaa on LinkedIn

Cross-platform mobile application development and payments



We have been piloting multi-platform mobile application development and payments in few client projects. Target platforms usually include iPhone, Android, Blackberry and Nokia Series 60. Also there are two notable usual cases which need to be specially handled

  • Image uploads
  • Payments for subscribed content

Sounds easy, right? Well it isn’t… Below are some notes for our due diligence work which you fellow developers might find interesting.

SDKs

Mobile phone vendors are jealously and don’t want to co-operate with each other. Building application which works in all handsets is major headache.

We found some reasonable candidates for cross-platform mobile development doing HTML and Javascript. HTML and Javascript pages are converted to native application using a wrapper technology (a.k.a. appaccelerator). Doing Flash Lite or Java ME can be pretty much forgotten nowadays as they won’t run on the most hyped platform, iPhone. Flash Lite has poor support for anything except content authoring due to primitive and limited APIs. Java ME provides horrible user experience.

(X)HTML is the only common language spoken by mobile phones. Thus, there has been a rise of “appaccelerators”, technologies which allow to create mobile applications with HTML(5) and Javascript.

  • Phonegap: iPhone, Android, Blackberry and possibly S60 in the future. Pluses: BSD license, very active community. Minuses: bad documentation, difficult deployment process.
  • Titanium: iPhone, Android. Pluses: Professional, Apache license. Minuses: Too tightly coupled with Appacclerator Inc. company.
  • Rhomobile: iPhone, Android, Blackberry, S60, Windows Mobile. Pluses: Professional, tries to build open source community, the widest platform support. Minuses: Dual licensing and tightly coupled with Rhomobile Inc.
  • Nokia Web-runtime: Nokia S60 and some other Symbian based phones. Pluses: Professional, good documentation. Minuses: Not open source, impossible to extend, Nokia has little interest to make this cross-platform, Nokia doesn’t like updating old models and web-runtime is useable only in the latest S60 5th edition models.
  • Palm Pre supports web applications natively. However Palm Pre application business is still taking a shape.

All these wrap the browser component (WebKit) and provide some extra Javascript APIs when your web pages as executed under the application mode.

  • Locationing
  • Contacts
  • SMS
  • Client-side database
  • and so on…

Rhomobile has little different use cases  from the rest of the bunch as it provides client-side programming using Ruby and less focuses on Javascript/web applications.

Payments and in-application purchases

There are four major way to do mobile payments “inside” the application for bought content and subscriptions. The price tag on the application itself is left out on this discussion as the application stores themselves take care of it.

  • Credit card
  • SMS
  • App Store payment (thus far Apple only)
  • Direct operator payments – you have a service provider (Bango) which can directly charge items to the operator phone bill based on handset identification.

App Store payment is the most attractive as it provides the best end user experience.  It allows you to use App Store payment mechanism inside the application. It is safe and no need to hassle with external payment providers. However, App Store payment can be used only for content consumed directly inside the application. You cannot use it e.g. for ordering a pizza. I think this might be related to recent EU legislation forbidding SMS payments for services not consumed in the phone itself.

SMS payment is ok for little payments. Operators take big cut of the revenue, generally 30% – 70% depending on the country. Short code fees usually start from 500€ set-up fee + 500€ / month. SMS cannot be often send as a background, but the user is presented the normal SMS editor which reduces the user experience somehow.

For credit card payments there exists several providers. Credit card has the cheapest entry fees, but the downside is that the user needs to have the credit card. This excludes teenager audience.

Direct operator payments are not very well supported yet globally. Most western operators support them. The operator also takes a big share and the fixed fee is pretty high.

My favorite payment provider thus far is Bango which provides credit card payment starting 9€ / mo. and scales up to worldwide SMS payments which cost few grannies per month.

In most cases, the payment experience will not be smooth. You need to open the phone main browser on the payment provider page to do the payment. This usually will close your own application. Rarely you can do the payment inside the application and support multiple platforms. After doing the payment most platforms allow you to close the browse and reopen your application using a special URL handler.

Wikipedia mobile payments page is also useful.

Image upload

<input type=”file”> won’t work on iPhone and some other platforms as those don’t have user browsable file system. Also the file dialog usually doens’t have image preview making it useless.

Phonegap has a branch which supports images picking using iPhone’s own gallery browser.

In any case, there is not yet cross-platform solution for this.

Future prospects

In some time-frame we will get rid of the need to wrap HTML applications natively as the web browser applications will support all HTML5 features without extensions and probably have some proprietary extensions for mobile specific features like SMS. We already have had some taste for this:

Building a mobile site and applications with Django and Python



Recently we created a mobile site for an interactive bicycle tour. oulugo.mobi (you need to use mobile browser to access the site or you’ll get a redirect) is a multimedia enriched bicycle tour through the historic parts of the city of Oulu. All content is provided by OnGo.

The route, which you can bicycle through is drawn on Google Maps. There are nine  action points where the user can listen to streaming audio clips, with still images, in his/her mobile phone. This is sort of  augmented reality experience: The user sees the real world (where he/she is now bicycling) combined with the historic events (audio playback narrative). For example, at Linnansaari (a location on the route) you’ll see the actual 17th century castle ruins and the narrator tells how the castle exploded when fire, caused by a lighting, reached gunpowder warehouse… boom. The explosion caused stones fly over 400 meters.

Alternatively, the clips are available as podcasts from Oulu Tourism pages. You can download them into your iPod for offline listening and use in conjuction with a paper map. This demostrates interesting mix of multichannel publishing: paper, web, mobile and podcasts.

The tour is bilingual in Finnish and English.

There exists unreleased iPhone application, based on PhoneGap, which allows the user to track his/her location real-time on the web page. We didn’t see it worth of trouble to go through Apple iPhone application review process. When location based service support comes for the browser this feature is indended to be included as the standard HTML5 feature of the service.

There also exists Nokia Series 60 mobile application, based on PyS60 and Series 60 BrowserControl API, which allows the user to track his/her location in real-time. The application provides wrapper around Series 60 WebKit control and allows Javascript to access phone native functions (GPS) over localhost socket communication. Like with Apple, we didn’t see real-time tracking feature interesting enough to go through Symbian Signed process to get our application released. Also, BrowserControl had seriousquality problems and we didn’t consider it stable enough for the end users. Some work is available in PyS60 Community Edition repository.

The service is hosted on Python specific virtual server on Twinapex services server farm.

Features

  • Premium content tailored for audio listening
  • Dubbed in English and Finnish by a professional voice actor
  • Bilingual: English/Finnish
  • Adapts for smartphones (WebKit based browsers) and low end phones (XHTML mobile profile browsers)
  • Streaming video and audio (RTSP / progressive HTTP download forv iPhone). Different audio quality is provided on depending on the handset features.
  • Screen resolution detection based on user agent sniffing. Three different version of images are used.
  • Custom Google Maps component for mobile is used. The component adapts for different mobile phones based on sniffing. Features include zoom, show action point, show the current location, search street address name. This component can be published on a request.
  • Management interface features include video upload, video transcoding different mobile versions and editing bilingual content
  • Apex Vertex handset database is used to detect the user’s mobile phone capabilities
  • Apex Vertex logging and traffic analytics capabilities are used for the site statistics

Software stack

Development effort

Development time: Around 100 hours. Three different developers where involved. Used development tools: Eclipse, PyDev, Subclipse, Subversion. There were around five meetings between the content provider and the technology provider. Few beta testing rounds using iPhone application were performed by bicycling in -10 celcius degrees weather (north and so on…). No polar bears were harmed during the creation of this mobile service.

The service is linked in from Oulu Tourism pages and thousands of paper brochures printed for Oulu summer season 2009.

About the author Mikko Ohtamaa

planetmobile.us up and running



planetmobile.us is a blog aggregator focused on mobile software development.The purpose of the aggregator is to give all good blogs in one packet, without the need to hunt them individually.

planetmobile.us was managed by Christopher Schmidt until I resurrected it few weeks ago.

Please feel free to subscribe your feed to the planet!

SDK released – Python in iPhone?



I just read waffle’s blog entry about iPhone SDK release. Looks like Objective C is the only supported language by default (I am just downloading SDK).The comments speculated that embedding Python is not possible due to size constraints. Bollocks I say =) Python for Series 60 phones is 500 kb download without trimming. It’s less than the size of HTML page you are viewing now – RAM footprint is even smaller) If Series 60 phones, which have much more modest hardware specifications, can run Python it shouldn’t be a problem for iPhones either.

Why Apple didn’t add additional language support by default? Well they seem to have their hands full to get SDK out at all (delays) so we shouldn’t expect to have perfect set in 1.0 release.

Now, who wants start a porting project with me? ;)