mori239 / websmsdroid

Automatically exported from code.google.com/p/websmsdroid
0 stars 0 forks source link

Slow operations in UI thread #801

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Dear developers,

I am studying WebSMS using a static code checker. I found some potential slow 
operations in WebSMS's UI thread.

Android documentation says this:

http://developer.android.com/training/articles/perf-anr.html

"Any method that runs in the UI thread should do as little work as possible on 
that thread. In particular, activities should do as little as possible in key 
life-cycle methods such as onCreate() and onResume(). Potentially long running 
operations such as network or database operations, or computationally expensive 
calculations such as resizing bitmaps should be done in a worker thread (e.g., 
via AsyncTask)."

I found the following event handler performing database queries and file IO:

de.ub0r.android.websms.WebSMS's onCreate() handler

Do you think these slow operations will affect WebSMS's performance (e.g., 
slowing down activity startup)? If yes, perhaps moving them to a separate 
thread can help make WebSMS super smooth in user interaction. Looking forward 
to your reply and hope I can help improve WebSMS.

Original issue reported on code.google.com by yepang...@gmail.com on 26 Jul 2013 at 1:02

GoogleCodeExporter commented 8 years ago
well, you are totally right.
the thing is, websms was my first android app and it is a port from j2me.
it has a very old code base and is quite odd in many cases. :x

if i would write the app from scratch, i would do most of the things very 
different.
i once started to refactor the code. but in the end, i gave up.
there were other important things to do. and the user base is shrinking. just 
because sms usage is shrinking globally.

if you want to make the app better in any case. just fork it on github and let 
me merge your changes.
i'd be very thankful. :)

Original comment by f...@ub0r.de on 27 Jul 2013 at 1:41

GoogleCodeExporter commented 8 years ago

Original comment by f...@ub0r.de on 27 Jul 2013 at 1:41

GoogleCodeExporter commented 8 years ago
That would be great. I am learning Android programming. Will find time to see 
if I can help refactor the concerned code :)

Original comment by yepang...@gmail.com on 27 Jul 2013 at 1:46