cwnga / code

code
0 stars 0 forks source link

assignment3 , please review #2

Open cwnga opened 11 years ago

cwnga commented 11 years ago

dear, my assignment 3 version 1 has done, but , no time to implement optional

https://github.com/cwnga/code/tree/master/android/week3/

/cc @nesquena @timothy1ee

nesquena commented 11 years ago

@cwnga Looks good overall, nice use of abstractions re TwitterHandler and HomeTimelineResult and it seems you got everything more or less working. Any questions for us about the assignment or any of the things we covered?

cwnga commented 11 years ago

I have a question about network loading, I remember network connection can not exec on topper level, it is because blocking activity exec , is it ? how to implement network connect (fetch data...) in background?, and then , i see the facebook app, it can loading text first , loading image later , how to implement this flow?

/cc @nesquena @timothy1ee thank you:)

timothy1ee commented 11 years ago

Anson,

You're right, network loading must not happen in the UI thread. If you're using the lower level networking libraries, then you must use AsyncTask to ensure that the network requests happen in a background thread.

In our past homework, we've been using a library called android-async-http which automatically wraps the network request in an AsyncTask.

Does that answer your question?

Tim