Live data from Hacker News

Facebook Does It Again. Cheating Dalvik

blog.mohitkanwal.com

21–30 of 66 posts

Re: Facebook Does It Again. Cheating Dalvik

#21
post #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!

I own a Xperia Play, that don't support anything after 2.3, and I have lots of gaming here, including shooters, platformers and racing

Re: Facebook Does It Again. Cheating Dalvik

#23
post #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!

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.

Re: Facebook Does It Again. Cheating Dalvik

#24

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…

> 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

Re: Facebook Does It Again. Cheating Dalvik

#25

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). It works on some Gingerbread devices (and, annoyingly, all emulated Gingerbread devices I've tried) but not all. So now I'm in the awkward position of either changing the minimum API level of my app to exclude all Gingerbread devices (even though it works on some) or annoying some Gingerbread users by getting them to download my (large) apk only to give them a "sorry, your device is not supported" message when they first open it.

I know nothing about iOS development, but I'm envious of the narrow range of hardware and software in that ecosystem.

Re: Facebook Does It Again. Cheating Dalvik

#26

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).…

IMHO, Google (Android) seems to be at fault here, as they lack a proper way to determine whether an app is compatible with a particular device, without false negatives.

Instead of getting angry at developers (eg. calling it "cheating" and a "horrible hack"), who want to maximize the compatibility of their app, the Android team should add a standard way for apps to define what they need to be compatible with a device, without getting false negatives.

Re: Facebook Does It Again. Cheating Dalvik

#27

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.

Consider switching to Xamarin + MonoGame. You will have to pay, but features might be worth it (better yet familiar language more mainstream in gamedev, decent cross-platform support). Alternatively try using Unity3d if you don't mind scripting instead of programming.

Re: Facebook Does It Again. Cheating Dalvik

#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 per apk.

Re: Facebook Does It Again. Cheating Dalvik

#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, emailed or communicated in other ways with specific individuals”

Post reply on HN