New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

put db access into background thread? #63

Merged
merged 6 commits into from Nov 2, 2014

Conversation

Projects
None yet
2 participants
@yulin2
Contributor

yulin2 commented Oct 21, 2014

Hi, I'm doing research on performance for Android apps. I found some event handlers access db from UI thread, but Android docs suggest us to avoid such blocking calls in UI thread. Do they lead to any responsiveness issues?

I tried to refactoring by putting them into background tasks. Looking forward to see your comments.

@yulin2

This comment has been minimized.

Show comment
Hide comment
@yulin2

yulin2 Oct 30, 2014

Contributor

I sent this pr several days ago. Any idea/comments?

Contributor

yulin2 commented Oct 30, 2014

I sent this pr several days ago. Any idea/comments?

@eidottermihi

This comment has been minimized.

Show comment
Hide comment
@eidottermihi

eidottermihi Oct 30, 2014

Owner

Hi yulin,
first of all thanks for your pr. I haven't spend much thought about db access in UI threads to be honest.

I will take a deeper look at your pr at the upcoming weekend, but at the first sight it looks good to me.

Owner

eidottermihi commented Oct 30, 2014

Hi yulin,
first of all thanks for your pr. I haven't spend much thought about db access in UI threads to be honest.

I will take a deeper look at your pr at the upcoming weekend, but at the first sight it looks good to me.

}
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {

This comment has been minimized.

@eidottermihi

eidottermihi Nov 1, 2014

Owner

My compiler says 'This method must return a result of type Void'.

@eidottermihi

eidottermihi Nov 1, 2014

Owner

My compiler says 'This method must return a result of type Void'.

@eidottermihi

This comment has been minimized.

Show comment
Hide comment
@eidottermihi

eidottermihi Nov 1, 2014

Owner

Hi yulin,
your PR looks good to me. Please fix the compile error and we're good to merge ;)

Thanks for your contribution!

Owner

eidottermihi commented Nov 1, 2014

Hi yulin,
your PR looks good to me. Please fix the compile error and we're good to merge ;)

Thanks for your contribution!

@yulin2

This comment has been minimized.

Show comment
Hide comment
@yulin2

yulin2 Nov 1, 2014

Contributor

good catch! I add the return statement. Thanks for the confirmation!

Contributor

yulin2 commented Nov 1, 2014

good catch! I add the return statement. Thanks for the confirmation!

@eidottermihi eidottermihi merged commit 1580f6d into eidottermihi:master Nov 2, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment