Comparison of Android vs iPhone vs Nokia vs BlackBerry vs Windows Mobile 7

by adrian vintu 4/13/2010 8:29:00 PM

I have previously published an Android vs IPhone comparison and many people requested that I do a comparison of Android vs iPhone vs Nokia vs BlackBerry vs Windows Mobile 7. So here goes.

Android

  • open platform http://source.android.com
  • can compile custom firmwares - good for hackers and other
  • good framework, extended on each new firmware
  • supports multitasking
  • nice IDE - Eclipse, NetBeans
  • development SDK is free
  • easy to debug, can send logs to developers
  • programming language is Java but bridges from other languages exist (C# .net - Mono, etc)
  • Java is a high level language that appeared in 1995. Android supports Java 1.5 and translates the byte code to its own custom Dalvik byte code optimized for mobile devices.
  • for the hardcore programmers, Android offers the possibility of programming in C using the native dev kit NDK
  • can run script languages like LUA, Perl, Python, etc
  • can install third party applications from sdcard, random sites - not locked to a specific market
  • applications can hook and override everything - email interface, SMS sending, custom keyboards, etc
  • supports widgets
  • can publish applications on the Android market instantly - initial one time registration fee is 25E
  • user has access to the sdcard and can use it as a USB disk
  • no Adobe Flash support yet. Probably will be available in Q2 of this year.

iPhone

  • closed platform
  • no multitasking except for some Apple applications. multitasking is probably going to be introduced in the next vertion of the iPhone, the iPhone 4
  • development kit costs ~90E
  • programming language is Objective C - but bridges exist from Java, C#, etc
  • Objective C appeared in 1986
  • next version of iPhone is supposed to only allow Objective C code, this means the bridges are out and you must program in Objective C if you want to create an iPhone application
  • applications are not allowed to duplicate the iPhone functionality - ie no custom email interface, etc
  • does not support widgets - unless the phone is jail broken
  • user does not have access to the sdcard - user can only do synchronization via internet or LAN
  • third party applications can only be installed from the Apple store. For testing the applications, developers can use Ad Hoc publishing
  • publishing on the store is a very lengthy and tiresome process. Apple has many and bizarre rules. Many applications were rejected for strange reasons.
  • no Adobe Flash support

Nokia

  • opened Symbian and says the future will be QT and WRT - they will cut support to any other environment including J2ME
  • QT is a framework that adds a layer of abstraction over gui, network, gps, etc.
  • QT is cross platform and cross programming language - C++, C#, Java, etc. the licenses are GPL and LGPL.
  • QT runs on Maemo, MeeGo, BlackBerry, Symbian, Android, iPhone, Windows Mobile, desktop PC, consumer electronics, car entertainment, etc
  • WRT - web runtime - a cool feature that allows users to write applications in HTML, JS and CS. You build the app like a normal web page, and you interact with the phone platform/hardware using the WRT bridge.
    No need to learn any other technology. Just HTML, JS and CS. Very important: JS can call native code, but also the other way around. It seems you can call WRT JS with native code.
  • supports widgets
  • supports Adobe Flash Lite

BlackBerry

  • as it is now, the programming environment is Java native and J2ME - not worth mentioning since they will probably be extinct pretty soon
  • no Adobe Flash support yet. Probably will be available in Q2 of this year.
  • we expect a new OS so we will just have to sit patiently and see what's going to happen

Windows Mobile 6.x

  • native C, C# with PInvoke - not worth mentioning since MS released WM7 and broke compatibility with 6.5

Windows Mobile 7

  • closed platform
  • MS breaks compatibility with WM 6.x - this is very bad
  • programming environment is Silverlight and XNA.
  • no native programming ie no hooking and overriding keyboard, etc - they removed PInvoke
  • nice IDE - Visual Studio 2010
  • does not support multitasking for third party applications
  • third party applications can only be installed from the MS marketplace
  • no Adobe Flash support

Notes


Android phones seem to be cheaper than the iPhone. Also the hardware is in some cases double than what the iPhone has.

For those coming from a Microsoft/Borland/Java background, Objective C will probably look like a very big step back - to say it as politically correct as possible.

Nokia says they will release the new phones end of this year and at a "lower price than ever". The Nokia phones are iPhone and Android clones - they can do what those two beasts can do, but nothing more. It seems they don't bring anything new to the table.

The available MS demos for WM7 are, to say the least, pathetic. It is a very non user friendly phone. Brings lots of changes (many not good) and totally breaks the look and feel the WM6.x owners were used to. Breaking software compatibility with WM6.x instantly puts many companies out of business.

The iPhone market seems to slowly but steadily go down. Some influence is the nice and cheap Android phone. Another reason for the iPhone sales dropping is that people are trying to get away from the whole iPhone=snob social stigmata.

In general, people tend to stick to their preferred phone manufacturer. Nokia fans are very excited about the new phones. Android users don't have anything better to switch to. BlackBerry users will never switch to other phones because of the great (subjectively speaking) physical keyboard.

The question is: what's going to happen to the iPhone and the WM7? I think the waters are too blurry at this time, so we'll patiently wait and see what happens.


EDIT: If you are an Android programmer, you must check this link out http://adrianvintu.com/blogengine/post/Colored-Logcat-Script-for-Windows.aspx


BlackBerry - IllegalStateException ArticInterface::DocPosToCaret

by adrian vintu 11/24/2009 2:26:00 PM
A few days ago I found another rare BlackBerry bug. I was playing with some list elements and everything was working fine until I ran the code on a BlackBerry Curve 8300.

I was suddenly presented with this popup.



I have never seen this error so I googled for it. Unfortunately there was no reasonable explanation. So I decided to investigate it.
First thing I did was to take a peek at the event log. I did it by pressing ALT+L+G+L+G and I got this.



Taking a look at the exception trace showed this.



I needed to see the full log for details, so I used
javaloader -u eventlog
to dump the event log (for this to work you need to check the  USB Cable Connected under the Simulate menu item of the emulator).
My javaloader file is located at c:\eclipse_g_341_jde7\plugins\ net.rim.eide.componentpack4.5.0_4.5.0.14\components\bin\JavaLoader.exe

The log looked like this.

guid:0x9C3CD62E3320B498 time: Mon Nov 23 15:05:00 2009  severity:1 type:3 app:Java Exception data:
        IllegalStateException
        ArticInterface::DocPosToCaret: error 3; formatted text length = 40;
        net_rim_cldc-11
         TextArea
         getTextBounds
         0x7B8E
        net_rim_cldc-9
         LabelField
         layout
         0x9D99
        net_rim_cldc-8
         Manager
         layoutChild
         0x1B98
        net_rim_cldc-11
         VerticalFieldManager
         sublayout
         0xC6F0
        net_rim_cldc-8
         Manager
         layout
         0x1A95
        net_rim_cldc-8
         Manager
         layoutChild
         0x1B98
        net_rim_cldc-11
         VerticalFieldManager
         sublayout
         0xC6F0
        net_rim_cldc-8
         Manager
         layout
         0x1A95
        net_rim_cldc-8
         Manager
         layoutChild
         0x1B98
        net_rim_cldc-11
         VerticalFieldManager
         sublayout
         0xC6F0
        net_rim_cldc-8
         Manager
         layout
         0x1A95
        net_rim_cldc-8
         Manager
         layoutChild
         0x1B98
        net_rim_cldc-11
         VerticalFieldManager
         sublayout
         0xC6F0
        net_rim_cldc-8
         Manager
         layout
         0x1A95
        net_rim_cldc-8
         Manager
         layoutChild
         0x1B98
        net_rim_cldc-8
         Screen
         layoutDelegate
         0x5375
        net_rim_cldc-2
         MIDPScreen
         sublayout
         0x9781
        net_rim_cldc-8
         Manager
         layout
         0x1A95
        net_rim_cldc-8
         Screen
         doLayout
         0x4B51
        net_rim_cldc-8
         UiEngineImpl
         pushScreen
         0xA538
        net_rim_cldc-8
         UiApplication
         pushScreen
         0x8A4B
        net_rim_cldc-2
         Display
         switchDisplayables
         0x3A60
        net_rim_cldc-2
         Display$SwitchDisplayablesRunnable
         run
         0x3FF5
        net_rim_cldc-5
         Application
         dispatchInvokeLater
         0xAAC
        net_rim_cldc-3
         MIDletMain
         dispatchInvokeLater
         0x4F78
        net_rim_cldc-5
         Application
         processNextMessage
         0x123D
        net_rim_cldc-5
         Application
         enterEventDispatcher
         0xA51
        net_rim_cldc-3
         MIDletMain
         main
         0x51FA
guid:0x97C9F5F641D25E5F time: Mon Nov 23 15:05:00 2009  severity:0 type:2 app:System data:JVM Error 104
guid:0x97C9F5F641D25E5F time: Mon Nov 23 15:05:00 2009  severity:0 type:2 app:System data:Uncaught: IllegalStateException

The event log shows a very interesting thing. It seems the J2ME list is rendered as a VerticalLayout that contains Labels.

We start by looking for TextArea. We cannot find it in the SDK so we look for the LabelField class. We find the LabelField in
C:\eclipse_g_341_jde7\plugins\net.rim.eide.componentpack4.5.0_4.5.0.14\components\lib\net_rim_api\net\rim\device\api\ui\component\LabelField.class
A quick look in the documentation of LabelField shows us the setText method can truly throw an IllegalStateException.

public void setText(Object text)

    Sets this field's label text.

    Parameters:
        text - Label text which may be a string, string buffer, character array, or byte array (may be null for an empty label).
    Throws:
        IllegalArgumentException - if text parameter is an unsupported type.

Source: BlackBerry JDE 4.5.0 API Reference: Class LabelField

Looking for the getTextBounds method gives us a few results, like
C:\eclipse_g_341_jde7\plugins\net.rim.eide.componentpack4.5.0_4.5.0.14\components\lib\net_rim_api\net\rim\device\internal\ui\Formatter.class
c:\eclipse_g_341_jde7\plugins\net.rim.eide.componentpack4.5.0_4.5.0.14\components\lib\net_rim_api\net\rim\device\api\ui\component\TextField.class
the method signature looks like
getTextBounds(IILnet/rim/device/api/ui/XYRect;Lnet/rim/device/internal/ui/ArticInterface$Line;II)

Since the TextArea is not available and the ArticInterface is also missing, we must move our search somewhere else.

What we can notice is the exception thrown has something to do with the caret - DocPosToCaret.

After a little bit of testing, I was able to reproduce the bug. It seems the bug appears when the list item contains a ‘\n’ char right in the beginning of the text and the text following will be long enough to need to be split on different lines.
Also, setting many ‘\n’ chars in the beginning will make the exception pop up for a smaller following text length.
Unfortunately, without the code we cannot say exactly how the algorithm in getTextBounds() works, but still, we now have a good picture of why this happens and how it can be avoided(for example, by removing the ‘\n’ chars from the beginning of the text, or by adding a space “ “ char in front of the text).

Some tech details:
1. this behavior only seems to exist in net.rim.eide.componentpack4.5.0_4.5.0.14 and not other emulators.
2. the bug appears on the BlackBerry Curve 8300 phone
3. you can download the code to reproduce the bug here ws_DocPosToCaretException.zip (599.40 kb)
4. the emulator specification looks like this


I hope you have enjoyed this rare to find bug, and if you want to see another one, a really funny one, then please also check this one here BlackBerry - This is sexy, isn’t it?.

BlackBerry - This is sexy, isn’t it?

by adrian vintu 10/15/2009 6:06:00 PM

Some time ago I found an interesting “feature” on the BlackBerry emulator.
It seems under special conditions we get some funny messages.

Luckily I was able to reproduce the behavior and here are the steps, the screens and the funny messages.

1. Run clean.bat in C:\eclipse_g_341_jde7\plugins\net.rim.eide.componentpack4.6.0_4.6.0.16\components\simulator\
or skip this but make sure the Contacts list is empty.

2. Copy my application to the simulator folder.

3. Run the application – should look like this.

4. Add any dummy contact, like this.

5. Run the application – you should get an error and get to this menu screen.

6. Choose “VM internal test” from the menu.

7. You should now get a series of screens looking like this. (1)

8. Screen 2.

9. Screen 3.

10. Screen 4.

11. Screen 5.

12. Screen 6.


So I got curious as to where the text comes from.

I looked for the “This is sexy, isn’t it?” string, but could not find it anywhere.
I almost gave up until I decided to try “bill” from the last screen, and to my surprise I got a result in Jvm.dll. Most of the strings were there. The file excerpt looks like this:

This *is* Banner    (1/1)   Patching Java   This *is* BANNER!   A Message   (too of fwee)   Oh no mr bill, something has gone horribly horribly wrong. oh nooo. o nooooooooo.

I was happy to find the source, but still no trace of “This is sexy, isn’t it?”.
Well, in my opinion this special text comes from some image memory copy operation, something like BitBlit in GDI.BitBlit.

Finally, mystery solved :)

Some tech details:
1. this behavior only seems to exist in net.rim.eide.componentpack4.6.0_4.6.0.16 and not other emulators.
2. other emulators offer the “VM internal test” menu option but do not show anything. They don’t even show a new screen.

As conclusion, I leave you with a question:

Who in the name of H and H is Bill and what is his role into all this?

If you find out, please let me know :)

Edit 2009-11-24: If you liked this article, you should also check another rare bug here BlackBerry - IllegalStateException ArticInterface::DocPosToCaret


About Adrian Vintu

Adrian Vintu I am a computer software professional lately designing and programming .NET and Android applications.
Send mail

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008 - 2010

Sign in