Bug #397

GUI updates in ActivityHubData causes performance problems

Added by Hans Cappelle over 5 years ago. Updated over 5 years ago.

Status:ClosedStart date:04/19/2012
Priority:NormalDue date:
Assignee:Hans Cappelle% Done:

100%

Category:-Spent time:-
Target version:2.0 Multiple models

Description

Required for performance

Need to separate capture of broadcasts from GUI updates
Suggestion:
  • Store parameters locally in a variable when receiving broadcast (in the updateUI method).
  • Add cyclic thread (similar to Dashboard runnableTick ) that takes the locally stored values and applies these to the GUI textviews

Something like

private void updateUI(Intent intent) {
        String channelType = intent.getStringExtra(FIELD_CHANNEL);
        double value = intent.getDoubleExtra(FIELD_VALUE, 0);

        switch (ChannelTypes.valueOf(channelType)) {
        case altitude_before:
            mAltitude_before = value;
            break;
        }
    }

// loop
tickHandler = new Handler();
tickHandler.postDelayed(runnableTick, 100);
runnableTick = new Runnable() {
    @Override
    public void run() {
        tvAltitude.setText(mAltitude_before);
        tickHandler.postDelayed(this, 100);
    }
};

Associated revisions

Revision 337
Added by Hans Cappelle over 5 years ago

closes #397 proper collecting of data on activity from broadcast and update GUI only on interval

History

#1 Updated by Espen Solbu over 5 years ago

  • Subject changed from buffer sensor hub data before broadcasting to GUI updates in ActivityHubData causes performance problems
  • Description updated (diff)

#2 Updated by Hans Cappelle over 5 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Applied in changeset r337.

Also available in: Atom PDF