3

I'm developing a location monitoring application for Android. One of my requirements is for it to be able to run for 7 continuous hours. To test that requirement I'm going to use the Android logging system to log the percentage of battery life left every 5 minutes (or possibly more). I might do this for an hour and then do some maths and work out if the application could run for 7 hours.

I read that the log entries are stored in a buffer. How often is this buffer flushed? Is there a better way for me to test my application?

I'm still doing some research on different approaches to take but unfortunately most testing guides assume that your device is connected to a PC.

Source : http://developer.android.com/tools/help/logcat.html

  • 1
    As a side note, your "7 continuous hours" requirement is worryingly vague. Is it 7hrs on a particular device? Is the battery new? What's the air temperature going to be? (OK, that's probably overkill but if it's for an arctic research team then it could be important!) – vaughandroid Feb 19 '13 at 17:05
  • Its a University assignment so I'm not overly worried about being 100% exact. I'm going to test it on a couple of devices that run Android. – Thomas Hutchinson Feb 19 '13 at 18:26

1 Answers1

4

Basically, it depends how much logging you (and other apps, and the system) are doing. Logcat uses a fixed-size buffer, rather than one with a maximum-age.

You can do adb logcat -g to see the size of the buffer on your device, as it varies.

vaughandroid
  • 4,315
  • 1
  • 27
  • 33