Thanks for the responses guys. My question was more like how come its smooth in the picture viewer app despite running multi processes? Its the only 2d app I've found that does this correctly, but its reassuring to know it DOES work.
Surface views seem good for static surfaces with moving objects on top, but bad for scrolling objects. Checking the picture viewer code again, I think they are using an oversided view with scrollto methods. I will try this later to see if this works better. On Mar 26, 11:26 am, Stoyan Damov <[email protected]> wrote: > I've also proposed a solution to this - adding a permission for apps > to request that they run alone, uninterrupted by other processes. > > That is, the app can request a permission, demanding that the app can > only be interrupted by an external event, such as phone call, all > other services and background processes (other than the ones the OS > can't go without) are paused when app is running. > > I know it's quite tricky to implement this, because, for example, when > an SMS is received it needs to be stored in the database, and this > will require some memory, which will need to be discarded, when the > SMS is written to the database, and this will trigger GC. However, > when such a message is received, and the OS knows that an app with the > special permission runs in the foreground, it could delay the GC > either until: > > - the app itself allocates memory (no matter if it might not be > actually GC'ed until the app finishes) OR > - the systems goes pretty low on memory > > At least, non-stock services (i.e. services, developed by 3rd parties) > can be suspended during the lifetime of an application requesting the > special permission. > > Cheers > > On Thu, Mar 26, 2009 at 11:51 AM, Stoyan Damov <[email protected]> wrote: > > On Wed, Mar 25, 2009 at 11:02 PM, Romain Guy <[email protected]> wrote: > > >> The trick is simple: avoid any allocation that might trigger a GC. > > > It's not that simple at all. > > In fact, it is *impossible* on Android, or any other mobile OS which > > allows background processes. > > > I've already said this once -- even though your game can be tuned to > > the max, nothing prevents *other* apps from triggering GC. > > That is, in my game, I *never*, *ever* do any allocation after startup. > > However, other background processes do trigger GC, and voila - my game > > stutters for a bit when GC kicks in. > > > Compare to iPhone, which disallows background processing and the > > foreground app is never interrupted. > > > Cheers > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

