Live data from Hacker News

Facebook Does It Again. Cheating Dalvik

blog.mohitkanwal.com

61–66 of 66 posts

Re: Facebook Does It Again. Cheating Dalvik

#61

Earlier quoted context omitted.

> * “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 h…

Yes, you're right that activities are broken up like that. Permissions are defined in the application manifest, and apply to all activities within the application.

Facebook would have to break their application into a calling app and newsfeed app to split the permissions apart. It would still request permission to record and take videos for both, though, if they implemented video recording on the newsfeed app.

Re: Facebook Does It Again. Cheating Dalvik

#62

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?

This hack can't screw up another application, the author is wrong about that. It's changing the local process only and has no influence on any other apps (which are not just sandboxed into their own processes but also their own user ids)

Re: Facebook Does It Again. Cheating Dalvik

#63
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…

The limit is being addressed, though not fully in L. It's discussed in the podcast at http://androidbackstage.blogspot.com/2014/08/android-develop...

Basically they're aware it's an issue and they're working on it both for the future of the platform but also in a backwards compatible way (using multi-dex and reflection).

Re: Facebook Does It Again. Cheating Dalvik

#64
post #23
post #9

Earlier quoted context omitted.

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!

If you code in C++, which most games do, the Android version is not that important, given the little exposure of Android APIs to the NDK. Everything that matters, besides the existing graphics, sensors and audio APIs, can be built with standard C++ libraries.

The problem lies with the hardware, I think. Truly, there's never a smooth moment with my phone. Sometimes it hangs for a minute. Random shutdowns and similar bugs in software as well.

Re: Facebook Does It Again. Cheating Dalvik

#65
post #18
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…

The bug they hit isn't the 65k limit, but the smaller LinearAlloc buffer size on older versions of the OS.

Yep i think the blog post referred the stuff as being LinearAlloc == dex method count, I have made it clear now.
Post reply on HN