Hacker News new | ask | show | jobs
by yuriyg 5029 days ago
Not trying to troll here, but can someone explain this "fragmentation" issue please? There's a single API for Android; there are also different versions of the API, but there's a same issue in iOS. Is the issue the different screen resolutions? Does all the Android developement require low-level access to hardware?
4 comments

The biggest issue with fragmentation is the extra hardware and the screen size.

The company I work for does Android development for the gov't, and we have had a lot of issues with difference in camera support for example. Yes, there is one API, but for each camera in a phone it behaves slightly differently.

The worst still is the different screen sizes. It will look and work perfectly on one or two devices, and then you try it on a third and all of the elements are laid out differently or are rendered wrong and we have to add a work-around for that specific device.

The other issue we have found is the different versions of the libraries that various different versions of Android ship with. For example BouncyCastle is extremely outdated, or sqlite versions differ enough that it works on one device but doesn't work on the other.

We've also had issues with the phone switching between the cellular network and then wifi whereby sometimes our app will get sent up to 50 notifications in rapid fire saying it is switching between the two, which causes our app to tear down/restart the connection process. We ended up putting a timer in that waits a couple seconds and uses the last notification that came in ...

That's not to say that iOS development also doesn't have its issues. I had one app that if you used the switch on the iPad for screen orientation lock that it wouldn't output sound due to the switch not being recognised correctly. A bug that still exists in the latest version of iOS, and still hasn't been fixed (here is hoping for iOS 6 (which I have not yet installed on this device), my radar got closed as duplicate). But iOS has less of an issue with fragmentation due to the fact that most of the hardware is the same, and people with iOS devices tend to upgrade en masse to the latest version when it is released so it becomes less of an issue to have an app require a new version of iOS and no longer function on older versions of iOS (although, I am still targeting iOS 4 for now when doing consulting/client work).

We've also run into some interesting documentation fragmentation points. Let's say you make an app for relatively technically unsophisticated users. You need them to drag some files to a folder on their SD card (the files are so large that you don't want to try and move them over a network). To do that, they need to mount their SD card on their computer's file system. How do you write the documentation that explains that?

Some mount to the file system as USB mass storage. Some devices call it "Disk Drive" mode. Some have a button called "Mount USB". Sometimes the button's in the notification bar. Sometimes it's in the settings. Some Android devices use MTP and the user doesn't have to do anything (but the names of the folders are different!).

You either get to write documentation like a choose-your-own-adventure novel or deal with confused users.

Thanks for your comments. I was hoping you would elaborate on what makes the screen sizes so problematic? Web developers have had to deal with different screen sizes and different resolutions for a long time. Luckily we have CSS which makes it much easier (and especially now with media queries). Is it that Android layout doesn't give you enough control?
The issue isn't layout control, although that could definitely be better, the issue is that even with all their fancy auto-resizing everything sometimes depending on the device/OS version you HAVE to hard code a pixel perfect layout or it just won't render correctly.

This means that even if you use Android's layout tools and create automatically resizing and fitting layouts it may not work correctly, and render incorrectly for example when you move from landscape to portrait, or move from one screen to the next. Highly annoying.

We've also had bugs that we could not reproduce on any of our test devices (all 27 of them that we have now ...) but that a customer had out in the field. We then attempt to locate the same device with the same OS version to test on.

Sometimes it has to do with themes that a manufacturer has installed not working correctly... this gets annoying fast when you've got the same phone on multiple carriers and they each customise it their own way.

Take a look at http://opensignalmaps.com/reports/fragmentation.php

Android manufacturers & carriers have little incentive to get you to upgrade [Apple sidesteps them and delivers updates directly]. Do you want to target a several-years-old platform to guarantee the most access?

Screen sizes are also a challenge. iOS (iPhone + iPad) has 4 different ones to choose from. Android has... a lot more than that.

Fluid layouts usually don't work that well -- awkward spacing here, awkward wrapping there. Notice how many web frameworks use fixed-width columns (like Twitter Bootstrap).

It refers to different Android versions on phones which results in developers being forced to test their applications against a lot of versions. Usually like in the case of iOS this would not have been a problem but Android updates are notoriously slow due to various reasons which means that most of the Android users are still stuck on gingerbread while jelly bean is already out. This means developers can't reliably take advantage of features added in newer versions of OS. Of course all this even before we consider the screen sizes.
The way Android layouts work and the backporting Google has done relieves a lot of this pain and you can now support only 2.3 and up and still get the majority of users.

If you want to get the kind of pixel-perfect layouts people have come to expect on the iPhone then yes that's a hassle. But I suspect the trend is away from that kind of design towards more flexible, information-centric designs just as it's been on the web.

20% of Android devices in the field are 2.2 or earlier. Its hard to tell a company that they should cut out 20% of their Android users in order to take advantage of the latest APIs.
Is it? My clients have all been fine with it. Going back to 2.2 isn't that hard but the people on those devices aren't likely to be very valuable customers.
Isn't it similar for pre-iphone 3 users, who also frequently get left out in the cold?
Isn't this a classic issue in software developement, where you have to require or assume some minimum OS version? Remember all those labels: "Windows 95 or higher required."

And especially with web developement, where you'd have to test your site on a various number of combinations of OS, browser, and resolution.

> There's a single API for Android; there are also different versions of the API, but there's a same issue in iOS.

Not really, no. http://thenextweb.com/apple/2012/03/06/why-do-developers-pre...