Live data from Hacker News

Facebook Does It Again. Cheating Dalvik

blog.mohitkanwal.com

41–50 of 66 posts

Re: Facebook Does It Again. Cheating Dalvik

#41
post #39

Earlier quoted context omitted.

> by then the market share of Gingerbread should be under 15-20 percent, too According to the Android dashboard [1], among users of Google Play Gingerbread has a market share of 13.5% [1] https://developer.android.com/about/dashboards/index.html

I'd like to see what percentage of app sales come from Gingerbread. My guess is that people that are willing to buy apps are not* using a 3 year old phone. (*edited)

People are not willing, right? Gingerbread phones are old and underpowered and can't handle the demands of flashy new apps.

I should buy one.

Re: Facebook Does It Again. Cheating Dalvik

#42
post #28
post #12

I understand, Dalvik uses 2 bytes to select a method found in the list at the start of the dex file and then to execute it. Is there any particular reason it is limited to 2 bytes ?

This is just me guessing but one of the initial goals of Dalvik was to use as little space as possible (due to memory constraints of hardware at that time). Perhaps they thought saving a a byte or two on method identifiers was a good idea. This would not be a problem if it weren't for the fact that dx also squashes all classes into one single class, meaning that instead of being 65K methods per class you now get 65K…

Ah, mobile. Recapitulating all the horribly constrained hacks of the early PC era, in handheld size containers.

Re: Facebook Does It Again. Cheating Dalvik

#43

Google early on made decisions about code size that made sense at the time, but now seem to be a serious limitation (at least in the interim). FB's decision on getting around this architectural limitation isn't all that bad. What I don't understand is how their solution can affect other applications. As an iOS dev screwing up my app is one thing but being able to screw up other apps seems like an even worse architect…

I'm confused on how it can screw up another application? Aren't all the applications sandboxed?

Given the state of Operating Systems 20 years ago, it would be very ironic if today the Apple OS doesn't let one app crash another, but the non-Apple OS does.

Re: Facebook Does It Again. Cheating Dalvik

#44

Earlier quoted context omitted.

2^16 counts as "weird and arbitrary"?

Since we stopped using 16-bit CPUs, yes, it does.

Since Dalvik Executables run on a virtual machine, and the Dalvik virtual machine's instruction set is 16-bit, it makes perfect sense.

Re: Facebook Does It Again. Cheating Dalvik

#45
post #29

Maybe it would have helped missing out in the mandatory spying features, and providing only the required customer features. Those features really take a lot of memory: * “Record audio with the microphone … at any time without your confirmation” * Take videos and photos using the camera * Access the phone’s call log * Read data about contacts stored on the phone, “including the frequency with which you’ve called, emai…

> * “Record audio with the microphone … at any time without your confirmation” There's no way in Android to record audio with the microphone at only certain times with your confirmation. Facebook needs microphone access for video and voice calling. > * Take videos and photos using the camera The Facebook app lets you take photos and videos to post on your feed. How else would they be able to do that without camera ac…

The Facebook app lets you take photos and videos to post on your feed. How else would they be able to do that without camera access?

Isn't the point of the Android app model of breaking everything up into Activities that you can call another Activity which does the video/photo recording, and then you just deal with the result?

(That's not a rhetorical question; I may be misunderstanding the intent of the design, or how people use the design in reality, or both.)

Re: Facebook Does It Again. Cheating Dalvik

#46

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'm in the end stages of developing my first Android app. Throughout development I used the Android compatibility libraries to get it working on Gingerbread. However, now that I'm almost finished, I realize that many Gingerbread devices have a hard limit on the number of simultaneous active MediaPlayer objects that means my app will not (and cannot) function properly. (All devices tested on ICS++ seem to work fine).…

I wouldn't be too worried. Gingerbread devices are something like <13% of all Android devices (out of something like 800 million). I'm going to go out on a limb here and assume that people still running 2.3 are probably not people who will be buying apps anyways.

Re: Facebook Does It Again. Cheating Dalvik

#48
post #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 h…

I imagine the devs and management don't care much as they're going to migrate to ART soon, which I imagine does not have Dalvik's circa 2003 design decisions. Google hasn't been investing in Dalvik because its days are numbered.

edit: why is this being downvoted? Do we really think ART will have these limitations? Android has been hot to get off Dalvik for many reasons and they're finally doing it in L. This is very good news and makes Andy Rubin-era Android decisions, which made sense for a 2003 phone, replaced with more modern thinking.

edit2: Apparantly, I'm wrong. Looks like the 16 bit limitation in still there in the current version of ART. Maybe this will change in the final production version.

Re: Facebook Does It Again. Cheating Dalvik

#50
post #39

Earlier quoted context omitted.

> by then the market share of Gingerbread should be under 15-20 percent, too According to the Android dashboard [1], among users of Google Play Gingerbread has a market share of 13.5% [1] https://developer.android.com/about/dashboards/index.html

I'd like to see what percentage of app sales come from Gingerbread. My guess is that people that are willing to buy apps are not* using a 3 year old phone. (*edited)

A gingerbread phone can by of any age. That's why google is moving towards a new contract for its gapps. Going forward you can only release the current Android or go as far as 2 versions back. So we're on 4.4 now, thus making 4.2 the oldest version for a phone released today (assuming the new contracts are in place).

A few manufacturers went a bit overboard mass producing GB-only phones lately because of how cheap their components are. I'm not sure what this means for the budget phone market now that they need to be 4.2 or higher on release date. From what I've seen, the new budget phone is the low-end Nokia Windows Phone with carriers like Cricket literally giving them away with rebates or charging next to nothing for them like $50, and that's on a no contract plan!

Getting Android out of the GB-era budget ghetto is a good thing. If the Moto E can handle 4.4 then so can everyone else. Supposedly 4.4 uses less ram than previous versions of the 4.x line. The head of google claimed that it can run on 512mb devices. They really, really want to kill GB. I imagine there will always be a android budget phone out there, just not no name junk running a near 4 year old OS.

The real question is how many more GB phones are there in the supply chain that will be sold this year and next? Millions? How long will these things be in play? It really does look like there is a real abandoned version of Android that can't survive fragmentation now. Many apps simply will not work. Shame really because I'm sure no one explained to the budget phone buyers that they were buying an ancient OS that can't be upgraded on that system with so little ram.

Post reply on HN