Custom Search

Tuesday, March 29, 2011

How To Troubleshoot a Crash-Prone Android App

The vast majority of the time, apps you download will work just as well on the 100th run as they did on the first. But there are times when things go awry. An app might be behaving itself, then spontaneously start force closing or failing to run at all. Android hides a lot of powerful functionality behind the scenes, and this is a time to break it out.

Read on as we tell you how to troubleshoot a problem app.

Kill it

This may sound, at first blush, rather callous and extreme, but this is the first thing you should try. If an app is misbehaving, you should manually close it. In Android, when you hit the home button, most apps don't actually close. They continue to live in the background. So if an app has encountered an error that it cannot resolve, making it restart completely is a good idea.

To do this, we suggest using the built in Android application manager. For most versions of Android, go to Menu > Settings > Applications > Manage Applications. If you are having issue with a stock app, make sure you have your full app list selected. Find the offending app, and tap it. At the top of the information page, you should see a Force Stop button. Tap that, and try the app again.

Additionally, if you have an app that often behaves badly when you hit the home button, try leaving it via the back key. This actually makes many apps close, instead of run in the background. Keep in mind, this is more likely to work for apps that are becoming unresponsive, or not performing correctly. If you are getting Force Close errors, this probably won't do anything.

Clear Cache and Data
Before we get into this, try restarting the phone. There's nothing more to say about it. Sometimes it helps. If it doesn't though, you may want to take out the cache for the app. Some apps, especially those that manage large amounts of data, can get into trouble with corrupted cache. Clearing the cache won't cause a real problem for you. Your current state will be lost, but things like account information will be saved. For example, an RSS or news reader would need to re-download articles if you clear the cache, but your feeds would remain intact.

To clear the cache, head back to the application management screen from the last section. Instead of force stopping, look down the page and tap the Clear Cache button. This is safe to do; there are even some apps in the Market that let you clear cache en mass. Be aware, not all apps have cache. If the app had 0B of cache listed, you might need to get more serious.

Clearing the data is sometimes necessary to resolve more serious problems. Unlike clearing the cache, this will remove all the information you have entered into an app. Things like saved games and settings are out the window. Just make sure you're certain the app is not working acceptably before continuing here. The button to clear data is just above the cache button.

We have found this of use for the Gmail app from time to time. If you have a flaky data signal when sending an email, it can occasionally get stuck in your outbox indefinitely. The only way to clear it is to delete the Gmail data. Since this is part of the Google services, your mail will download again in a few minutes.

Reinstall the app
Next order of business if none of that worked is to uninstall and reinstall. This more or less accomplishes everything you've done this far at once. But try the piecemeal approach first to avoid unnecessary data loss. You can uninstall apps through either the Market app, or from the application management interface we talked about earlier (the button is at the top). For system apps, uninstall the updates.

In either case, go back to the Market and reinstall the app. If it runs, great. If not, things could be looking grim. Since you've tried everything there is to try, you'll need to start looking for lower level issues.

The system log

When an app force closes, you have the option to report the error instead of just tapping Force Close. If you go into the report, you can see the information that will be sent to the developer. You can add comments as well. You might as well send the report since there may be an incompatibility with your phone. Before you do this, have a look around.

On most Android builds there is a preview button on this screen. If you tap it, you get access to the log information that will be sent. Check the system log to look for anything odd. You might have to scroll down a bit to get to the most recent events. There are also apps that will let you check the log without going into the FC preview. Searching for 'logcat' will bring up many options. We really like CatLog.

Watch for any confluences of events. For instance, every time your app crashes, is the same things happening in the background? This can give you a clue as to apps interacting poorly, perhaps multiple apps are trying to access the same hardware at the same time.

It is possible that an app is not yet compatible with your phone. Sending the error report can help improve support, so you ought to do it.

You may not be able to resolve the issues surrounding each and every problem app, but if you follow these steps you will be able to separate the truly incompatible from the temporarily busted. We hope you never have to do this, but life (and force closes) happen.

No comments:

Post a Comment