back to article Meet the BlackBerry wizardry that created its 'better Android than Android'

Some remarkable technical wizardry lies behind BlackBerry’s Android coup. When it was launched in January, BlackBerry’s new OS was brand new BlackBerry 10 and largely app-less. But today it can execute Android apps at impressive speed. How did they do it? Thanks to some helpful inside knowledge, The Register will reveal it all …

COMMENTS

This topic is closed for new posts.

Page:

  1. Michael C.

    More of this, please

    This is the sort of tech news I need to read about on a daily basis. Interesting stuff, more of this please!

  2. sabroni Silver badge

    Security?

    So how secure is the supposedly locked down business side of BB10 now android apps can call into blobs of code that no one at BB understands?

    1. Paul Shirley

      Re: Security?

      In also struggling to see how an essentially brute force hack is "clever". Hard work but clever?

      A clever solution would have isolated all app components in their own pseudo VM and shimmed emulation under it, allowing some amount of security to be enforced.

      1. Anonymous Coward
        Anonymous Coward

        Re: Security?

        An alternative would be to run Linux in a VM and then Android on top of that. This would be in some ways cleaner, but would greatly increase the RAM requirements, since there'd be two separate full OSes running at the same time. Cleaving at the POSIX layer reduces duplication of OS resources.

        As for security, the Android binary blob is no different from any other binary blob QNX runs in user space. (A 3rd party BB10 native app is as "blobby" to the company as an Android binary.) It doesn't increase the surface area for attack.

    2. Bigboy1

      Re: Security?

      The android apps can be housed in a Secure container using blackberry "Balance". There is no inherent danger to using android apps. It is no different than accepting any other form of unsecured data, or any blackberry native app because they is don't have access to root.

      This is coup pure and simple. There really is no reason to consider the Blackberry anything less than a "better android than android". Still the average consumer is going to just grab whatever phone he last saw on a tv commercial. That's why Blackberry is best to focus on Enterprise or a couple years and look for another chance to crack the wider consumer market.

  3. CAPS LOCK

    Hmmm, this reminds me of "A better Windows than Windows"

    Being better at running your competitors applications is not a road you should go down.

  4. hamoboy

    This might be a lifeline, but nothing more

    So in effect, the message Blackberry is giving to app vendors everywhere is "Write for Android, and you'll target us too". Thus removing any motivation for these developers to try and write native QNX apps. Even in Apple's darkest days before the iPhone, they never bundled Parallels or any such emulation software with their machines, they knew that that might have provided a short term gain, but long term it would have been a sign of surrender. Vendors don't want to targer a platform whose makers have surrendered.

    1. Victor Cooper

      Re: This might be a lifeline, but nothing more

      I have owned a series of Macs since 2007. I would not own one for work today if it did not have VMware , Virtualbox or Parallels support. There are still many native apps that the Mac platform does not support. As big as apple is today, the Mac native app support is still pretty poor at least in the workplace. I don't agree with your argument.

      1. hamoboy

        Re: This might be a lifeline, but nothing more

        But Apple never BUNDLED emulators with their machines. It was always an aftermarket purchase. In the same way, Blackberry should have made this something users could add on later, not something that comes with the phone. App now have negative incentive to make a native QNX port.

    2. david 12 Silver badge

      Re: This might be a lifeline, but nothing more

      >Thus removing any motivation for these developers to try and write native QNX apps

      dunno. Blackbetty has native support for QT: Android doesn't. It convinces us.

  5. Anonymous Coward
    Anonymous Coward

    All worthless thou.

    1. Blackberry is dead.

    2. There are still compatibility issues.

    3. There will never be Google Play store.

    Go get a Nexus5 and save yourself the grief that will surely accompany BB10 ownership.

    1. Anonymous Coward
      Anonymous Coward

      Re: All worthless thou.

      I have followed your advice and am still trying to work out where to insert my SD card. Also, I can no longer go two days between battery charges. How do I fix this?

      1. Dave 126 Silver badge

        Re: All worthless thou.

        >Go get a Nexus5 and save yourself the grief that will surely accompany BB10 ownership.

        >>I have followed your advice and am still trying to work out where to insert my SD card. Also, I can no longer go two days between battery charges. How do I fix this?

        Er, trade it in for an LG G2?

      2. jonathanb Silver badge

        Re: All worthless thou.

        Apparently you can use a USB2go cable to attach a USB mass storage device, so a SD card adapter at the other end of that cable should do it. Not as good as an internal slot, but it can be done.

    2. Victor Cooper

      Re: All worthless thou.

      Have a Nexus 4. No thanks to the Nexus 5. With the news that it can run apks directly I just ordered the Z30. Pinch gesture in the HUB to close out / open read mails, custom quick menu and the native Blackberry Express on the fly presentation tool are just 3 of many great features I am looking forward to. So no thanks again to the Nexus 5. My nexus 4 will be a more than adequate backup to my Z30 upgrade.

  6. Mage Silver badge
    Flame

    It won't save RIM/Blackberry

    But it may make QNX more valuable in the eventual firesale.

    A great trick/hack though.

  7. David Kelly 2

    Blackberry has Android-envy

    If Blackberry is going to expose themselves to all the faults and flaws in Android then they might as well ditch the excellent QNX and go Android-native.

    1. Anonymous Coward
      Anonymous Coward

      Re: Blackberry has Android-envy

      No, they gained access to Android apps *without* exposing their entire system to all the risks and flaws (perceived or otherwise) of Android. The Android player is in its own app container and can be walled off from other apps and system resources.

  8. Anonymous Coward
    FAIL

    But apparantly they couldn't get BB10 running on the Playbook! Hmm...

    1. Bronek Kozicki

      Yes, that got me peeved too. However, PlayBook only has 1GB RAM and all BB10 handsets have 2GB , I understand this extra 1GB requirement is actually there for a reason.

      Here is a thought: could this hack possible reduce some memory weight of Android runtime, thus making PlayBook viable again?

  9. John Sanders

    Ok if QNX could do it why not linux?

    When are we going to get an Android runtime for Desktop Linux?

    Come on, It should be possible to run .apks on Linux by now!!!!

    1. larokus

      Re: Ok if QNX could do it why not linux?

      Run an emulator to run an emulator!! Bluestacks for windows is android on your desktop. :D

    2. Anonymous Coward
      Anonymous Coward

      Re: Ok if QNX could do it why not linux?

      You mean like this?

      1. Anonymous Coward
        Anonymous Coward

        Re: Ok if QNX could do it why not linux?

        Android players for PCs won't run ARM native extensions directly on the CPU like BB10 does, given that PCs are x86.

  10. Nathan 6
    FAIL

    So after Management has hit the Iceberge ...

    So after management ran the ship headlong into an iceberg, and fled into their golden life rafts, its up to the engineers to save the company with "this cool hack"? At this point, the ship is halfway to the bottom, and no amount of hackery can save it.

    Only thing that would have save them would be if they had build a Java API on top of QNX from the start, or just rolled their own Andriod OS 3-4 years ago. However, that would have required competent management.

    Kinda reminds me of the whole JCPenny mess, in which a new CEO and his management team were given ~80 million in one year to save the company, and guess what, company is now way worse off. The JCP board would have been better of just setting 80 million dollars on fire or just given it to their employees.

  11. John Smith 19 Gold badge
    Thumb Up

    "one of Skype or Instagram even had self-modifying code"

    Wow.

    That would make one of them the third legitimate use for this technique I've heard of (I gather it's popular with malware writers, but apart from them it's not really clear who else). The othere 2 were the AT&T "Blit" bitmapped graphics terminal and the Apollo Guidance Computer.

    The article does not give enough tech detail to understand what they've done. I'm getting (having nosed through Wikipedia)

    1)Dalvik is a special JVM. It reads its own file format that is more compact than Java .class files.

    2)RIM engineers have ported it.

    3)But QNX <> Chrome <>Linux (IIRC Chrome has been formerly forked from Linux)

    4)Their hack operates below the kernel function call level and operates right at the software interupt (SWI) instruction level (actual ARM op code) AFAIK a OS kernel call can have multiple SWI calls inside it.

    5) But I'm b**gered if I know how.

    So thumbs up for the hack, whatever it is.

    Only time will tell however if the management manage to snatch defeat from the jaws of victory. :(

    1. Michael Wojcik Silver badge

      Re: "one of Skype or Instagram even had self-modifying code"

      That would make one of them the third legitimate use for this technique I've heard of (I gather it's popular with malware writers, but apart from them it's not really clear who else).

      Self-modifying code was quite common in mainframe applications at least into the mid-1980s. It was often used in assembly-language apps for things like patching, on-demand loading, memoization, etc. Some higher-level languages supported it directly, such as COBOL with its ALTER statement.

      I've also seen it used in some performance-critical code, again back in the '80s. As CPU caches became more complex, there was a lot of discussion about their effects on self-modifying code.

      Depending on what you consider "self-modifying code", you might also include some techniques that involve dynamically-generated code, such as GCC trampolines (which build code at runtime on the stack). That's not usually considered self-modification, though.

      As for how the QNX technique works: it's really not that complex (or new - Andrew oversells it in the article). The interrupt handler looks at the parameters to determine whether it's a QNX syscall or a Linux syscall. In the latter case it probably jumps to a thunk that does the conversion. (The conversion could be done in the handler, but that'd be messy.) QNX and Linux syscalls are mostly equivalent, thanks to POSIX, so it's mostly a matter of massaging parameters.

  12. David Simpson 1

    Considering that 4.4 KitKat has the option to replace Dalvik with ART, by way of a test it stand to reason that by 4.5 or 5.0 ART will be default and all Blackberry's effort will seem rather pointless.

    1. Richard Plinston

      > it stand to reason that by 4.5 or 5.0 ART will be default and all Blackberry's effort will seem rather pointless.

      ART is open source too. BB can build their own version.

      In any case ART does run Dalvik apps, it just starts them faster by running the 'JIT' compiler on installation rather than at app startup (plus other optimizations). The apps aren't any different so they will still run under Android Dalvik* and BB Dalvik.

      * NOTE: there is no plan to obsolete every app** in the play store nor all pre-4.5 Andoid phones** and tablets just to make BB unhappy.

      ** cf Windows Mobile 6.x and Windows Phone 7 where they _did_ do that to their own developers, OEMs and customers.

  13. Anonymous Coward
    Anonymous Coward

    A Better Android?

    Take Android, remove the underlying Linux OS, slide in the QNX OS in its place and maybe, just maybe, you have a more reliable Android platform. Maybe BlackBerry is on to something here...

Page:

This topic is closed for new posts.

Other stories you might like