Hacker News new | ask | show | jobs
by stickydink 4331 days ago
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.

5 comments

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.

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.

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

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

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.

> Google is now requiring OEMs to only launch devices that are 2 versions and/or 9 months old

Are they requiring anything from carriers or phone shops, though? Because everywhere in my town is still selling Gingerbread devices to anyone that doesn't know better.

There is a way: https://github.com/creativepsyco/secondary-dex-gradle

The new gradle build system really simplifies a lot of things in terms of the build cycle

When did it come out ? I suspect it wasn't adopted widely a year ago.
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.
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.
I've got an old cheap 4 year old Acer phone running 2.3 as a backup phone and it plays lots of games fine. Sure not games using a lot of 3d graphics or games which require very precise timing, but it plays lots of other games.
I just played through Swordigo on a Galaxy S (the first one!) and it ran very smoothly. I am, it may be worth noting, using Cyanogenmod 11 nightlies.
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
Oh you will be surprised: Not every game requires higher Android version, they are mostly satisfied with c++, http://imgur.com/iX4dcL5

Card Games: Gingerbread (14%)