Why Appa crash

Date:1 September 2011 Tags:, ,

App crashes. They frustrate iPhone and droid users alike. They cause people to sit and stare at their phones in frustration and mutter, “why won’t this work?” we talked to David Janzen, associate professor of Computer Science at California Polytechnic State University, and Calvin Carter of Bottle Rocket Apps to find out why apps crash. By Steve Rousseau

Sloppy code

A majority of app crashes come simply from programmer error, according to Janzen, the most common occurring when a programmer references an object or variable that doesn’t exist, technically called a nullpointer error. “When a programmer is developing an app, they have to be very careful to try to anticipate things that can go wrong,” he says. “When they don’t, that’s what can cause a null-pointer.” Another aspect is sloppy handling of multitasking, or threads, as programmers call them, Carter explains. Threads act like lanes on a highway: most of the work is done in the left lane, or main thread, but the programmer can move work to other threads if it starts to get backed up.

Spotty connection

Even if programmers manage to keep their code tight and efficient, their handling of a poor network connection can force an app crash as well. An unreliable connection can cause your phone to retrieve bad data or even get no data at all, Carter says. “Many programmers, green and veteran alike, make mistakes with how to handle something going wrong when the data is en route,” he says. “It’s very easy to make an app that works great in your office on Wi-Fi, but crashes for a user on 3G on a train.” A solid app should plan for a drop in connectivity. “If you assume that you got (the data), then you get into trouble,” Janzen explains.

Memory management

Although phones and tablets have advanced greatly in terms of CPU speed, developers still need to manage memory and processing power to keep their apps crash-free. It’s very important for Android programmers not to tax the system when their app boots. If an app takes more than 5 seconds to launch, it’s killed by the OS. “Having to worry about speed is a big concern,” Janzen says. “You want to be really careful and just do little things to get it started.” Unlike in the Android platform, iPhone developers must manually manage memory. They tell the OS which objects are in use and which aren’t (also known as marking), and if they try to use an object that’s marked as not in use, then – crash!

Latest Issue :

May-June 2022