Best practice to test what happens when my application is killed

by qvark » Tue, 09 Mar 2010 23:23:12 GMT

Sponsored Links

I'm having troubles with users that report that if they leave the
application opened and after a few hours when they return to it the
app crashes. I'm pretty sure it is because I'm not storing/restoring
the status correctly when my process is killed by the system, but I
would like to be able to test it in a repeatable way.

Which is the best way to simulate the same behaviour that happens when
Android kills my process on low memory conditions? (killing the
process from the DDMS view, sending a signal from the adb, ...)


Jose Luis


Best practice to test what happens when my application is killed

by TreKing » Wed, 10 Mar 2010 00:21:16 GMT


Perhaps not the "best", but an easy thing to do is just open your app, press
home Key, the proceed to open a few other apps (heavy stuff like the Browser
or Maps), then try your app again. It will probably have been killed.

TreKing - Chicago transit tracking app for Android-powered devices 


Sponsored Links

Best practice to test what happens when my application is killed

by Lance Nanek » Wed, 10 Mar 2010 03:02:04 GMT

 The Dev Tools app on the emulator has an option that might help:


Best practice to test what happens when my application is killed

by Streets Of Boston » Wed, 10 Mar 2010 05:29:06 GMT

 If you want to test the case when Android kills your app, just use the
DDMS view (as you said) and hit the red stop/kill button. This'll kill
your app's process. Then restart your app and see what happens.


Other Threads

1. Why cant I install an apk from asset folder


I have an X.apk which contains another Y.apk within is asset folder.
While X activity is trying to install the Y.apk android shows a
parsing error while installation. The Error message shown on the UI is
"There is a problem in parsing the package", while the adb logs shows
"WARN/PackageInstaller(270): Parse error when parsing manifest.
Discontinuing installation". The same Y.apk if i put in another
location (data/data/Y.apk) i can install fine from X.apk.

Is there a reason why Y.apk can't be put in asset folder ? or is there
a neater way to do this ?

thanks for your inputs,


2. Preferences screen won't rotate

I have a vanilla preferences screen with just a few preferences.
Here's the XML that defines it:

<?xml version="1.0" encoding="utf-8"?>
<CheckBoxPreference android:title="Convenience Buttons"
android:summary="Shows or hides the convenience buttons (1d2, 1d4,
etc.)" android:key="showPref" android:defaultValue="true"></
<EditTextPreference android:defaultValue="1" android:summary="Default
number of dice to roll" android:title="Number of Dice"
<EditTextPreference android:defaultValue="2" android:summary="Default
size of dice to roll" android:title="Size of Dice"
<EditTextPreference android:defaultValue="0" android:summary="Default
modifier to apply to rolls" android:title="Modifier"


I've compared it to a number of samples I've found on the web, and
I've Googled around, but I've not found anything that would cause my
problem, which is this: When I rotate my phone, the preferences page
doesn't arrange itself into a landscape display. I tried it on a
friend's Android-powered phone and hers didn't rotate either. Other
apps on my phone rotate their preferences pages correctly, but mine
doesn't. What have I missed?

It does rotate correctly in the emulator.

Thanks much.

Jay Bryant


3. how to get noticed when the My Location setting location service is enabled or disabled by user

4. Question Regarding an App

5. How would you go about import an image from the users gallery and use it as a resource?

6. Compatibility

7. Bring application on top