Search code examples
blackberryapplicationmanager

How long an application is used in BlackBerry


I've seen is posible to know what applications are running with getVisibleApplications()from "ApplicationManager" class but, is it possible to know how long were these applications used?

Thanks


Solution

  • If you really needed this information it would be possible. You could have a background process start a timer and every N minutes it could call getVisibleApplications() and keep track of what has been added or removed to the list.

    The difficulty is finding the right balance between accurate data and battery life as a very small value of N (seconds/minutes) will prevent the device from sleeping and will cause severe battery life degradation. A very large value of N will have minimal effect on battery life but the data won't be very accurate.

    You could also combine it with events... maybe you would monitor aggressively when the backlight was on and hourly when it's off.

    Not really sure what you're trying to do so my apologies if this doesn't help at all.