Softpedia
 

NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
TRENDING TODAY
Home > News > Webmaster > Internet Life

March 5th, 2013, 14:05 GMT · By

With Help from Google, Facebook Hacked Android's Dalvik Core to Work with Gingerbread

SHARE:

Adjust text size:

Facebook is willing to go to great lengths to get its app working on all devices
Enlarge picture
Facebook and Google haven't always seen eye to eye. In fact, it's fair to say that the two companies are pretty adversarial. But they do and have to work together on some things, such as the nature of the web and the tech world.

Facebook is one of the most popular apps on Android, across the world, for example. Android would take a big hit if the Facebook app were gone or worked poorly; Facebook would take an even bigger hit if it couldn't reach the hundreds of millions of Android users except via the website.

This is an even bigger problem now that Facebook is all about the mobile space. So when it hit a relatively arbitrary limit with the older Android 2.3 Gingerbread that meant it couldn't add any more features to the app, it worked alongside Google to fix it.

Facebook is one of the most complex apps for Android and one of the biggest, in terms of code. This created a rather unique problem on Gingerbread devices.

The Facebook app uses a lot of methods, over three million of them, too many for the older Android to handle.

The problem was down to the size of the buffer used to store the full list of methods used by an app at install time. Facebook worked around this by splitting the Facebook app into several components, which would be loaded separately.

But it turned out that this only fixed the issue at install time, the app still crashed when running because the same buffer with the same limits is used by running apps as well.

Loading the different components separately worked during the install process, but in the end the app still had too many methods to fit inside the buffer.

The one solution Facebook came up with was to replace the code that creates the buffer on the fly. That code is part of the Dalvik Java Virtual Machine, which underpins all Android apps.

To modify it, Facebook first had to determine where that specific piece of code is stored in memory and then proceed to overwrite it with its own code, a risky procedure at best.

But that's exactly what Facebook did, with help from Google in fact, which let it use one of its Android testing labs to run the app on 70 different phones to see if it works.

Needless to say, this was only possible because Android is open source. A closed source operating system would have required Facebook to reverse engineer the code, not a simple proposition, not to mention something that would get it thrown out of any app store.
FILED UNDER:
Google
Facebook
Android


1,069 hits
Link to this article · Print article · Send to friend

MUST-READ RELATED ARTICLES:


Why Google Is Right to Block Google Maps on Windows Phone 8

The New Yahoo Homepage Is Here, Marissa Mayer's First Big Project

Mozilla Explains Why Firefox OS Apps Are Fundamentally Better than Native Mobile Apps

GIF 2.0: Twitter May Be onto Something Huge with Vine

Facebook's Still More Popular on iOS, but Android Is Going to Be Huge

READER COMMENTS:



No user comments yet.
Be the first to express your opinion!
Copyright © 2001-2013 Softpedia. Contact/Tip us at

WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM