Fast, accurate timing for both widget AND app in Android? -
i have widget/app performs display [draw...()] operations 20 times second (e.g. animation), depending upon user-selected criteria. when running widget, "full" app invoked when widget touched. (the full app performs similar display operations has more bells , whistles widget.) want use same timing mechanism both widget , "full" app haven't figured out how manage this.
widgets seem rely on alarmmanager, not provide sufficiently accurate timing purposes, though it's @ least tolerable when running widget. before turning app widget, used combination of timer , handler , seemed work ok.
timerhandler = new handler(); timer = new timer(timerhandler, drawaction);
any thoughts on how might accomplish goal (assuming it's possible) appreciated.
i'm going agree commonsware here- widget should not updating frequently, widgets should infrequently updating summaries. once second ok if you're clock. else should every few seconds or few minutes.
anyway, timers , handlers pretty old school way of doing animations. choreographer correct way of getting regular callback, every 1 60th of second. better, use android animator , interpolator objects regular updates , call setanimation on view, avoiding cheduling of own.
Comments
Post a Comment