Live data from Hacker News

Facebook Does It Again. Cheating Dalvik

blog.mohitkanwal.com

1–10 of 66 posts

Re: Facebook Does It Again. Cheating Dalvik

#2
We have this problem. We have a large, mostly-Java game for Android. It won't run on gingerbread, because we just have too much code.

While the official solution looks quite brief, retrofitting it is a nightmare. Unless Facebook got around to rewriting everything again, I can understand why they'd do it their way.

Re: Facebook Does It Again. Cheating Dalvik

#3
I'm a bit confused by this article, the author mentions:

    While the official standard way to to fix this problem is described in the offical Android Blog.
    Seems like Facebook missed it. What a waste.
However, in the post linked by facebook, they explain why they couldn't use it (vaguely)

    After a bit of panic, we realized that we could work around this problem by breaking our app into multiple dex files, using the technique described here (http://android-developers.blogspot.com/2011/07/custom-class-loading-in-dalvik.html), which focuses on using secondary dex files for extension modules, not core parts of the app.

Re: Facebook Does It Again. Cheating Dalvik

#5
There's a weird and arbitrary limitation in Dalvik, and the Facebook guys needed to work around it. The author makes it sound like it's some horrible sin. How about shaming the Google developers who thought 65k methods was enough for anyone? Wouldn't be good proper either, because they probably had a good reason for it.

Software development isn't always stacking neat abstractions on top of each other. Sometimes you have real hardware and real legacy and you just got to deal with it, one way or another.

Re: Facebook Does It Again. Cheating Dalvik

#6

We have this problem. We have a large, mostly-Java game for Android. It won't run on gingerbread, because we just have too much code. While the official solution looks quite brief, retrofitting it is a nightmare. Unless Facebook got around to rewriting everything again, I can understand why they'd do it their way.

If it's too much of a hassle to make your app work on Gingerbread, just don't bother with it anymore. I bet Google themselves will end all support for Gingerbread next year when version M comes out (as they should). It just doesn't make sense to support it longer than that, and by then the market share of Gingerbread should be under 15-20 percent, too. Gingerbread is the XP of Android - an old popular version, right before major architectural changes.

Android L seems to be the next major architectural change, but I don't think KitKat will be the new Gingerbread, because Google is now requiring OEMs to only launch devices that are 2 versions and/or 9 months old, which will soon mean (going by the new release cycle) just 1 version behind. So the transition for new versions should happen a lot smoother in the future.

Re: Facebook Does It Again. Cheating Dalvik

#7
post #4

I don't see how facebook cheated Dalvik 'again'? Seems like it's still just the one 'patch'/'hack'. Am I missing something?

What they do "again" is pull some nice engineering feat that's also a bit of a hack, and therefore fun to read about. I assume the author is impressed, and likens it to some of Facebook's similar bend-the-world-to-my-turd undertakings such as patching git to be able to deal with Facebook's single gigantic (!) source code repository.

Re: Facebook Does It Again. Cheating Dalvik

#9

We have this problem. We have a large, mostly-Java game for Android. It won't run on gingerbread, because we just have too much code. While the official solution looks quite brief, retrofitting it is a nightmare. Unless Facebook got around to rewriting everything again, I can understand why they'd do it their way.

I don't think anyone with a phone running 2.x can run games. I have an HTC One or whatever (4 years old; got it from a friend) and I could never ever imagine playing a game on it. Even the home screen lags!

Re: Facebook Does It Again. Cheating Dalvik

#10
post #7
post #4

I don't see how facebook cheated Dalvik 'again'? Seems like it's still just the one 'patch'/'hack'. Am I missing something?

What they do "again" is pull some nice engineering feat that's also a bit of a hack, and therefore fun to read about. I assume the author is impressed, and likens it to some of Facebook's similar bend-the-world-to-my-turd undertakings such as patching git to be able to deal with Facebook's single gigantic (!) source code repository.

Oh, I see. I assumed the 'it' in the post title referred to the 'Cheating Dalvik' that followed. Not that it referred to a more generic concept of bad-practise.
Post reply on HN