Java : a WebService asking embeded in a AsyncTask

后端 未结 2 1963
感动是毒
感动是毒 2020-12-12 07:04

. Hi, as a young android developer i was looking at a way to get a JSON response from a server. I started looking at AsyncTask but i not feeling comfortable to code an Async

2条回答
  •  抹茶落季
    2020-12-12 07:44

    Your use of AsyncTask appears appropriate. As you may be aware.. for network communications you must use AsyncTask or your own thread (extend HandlerThread.)

    If your app is frequently calling AsyncTask or is executing simultaneous AsyncTask then creating your own thread will be more efficient (all AsyncTask requests use a single thread in API 13 and up.)

    I'm unfamiliar with your app and how it functions.. do your users require the dialogs and status feedback for thses background network transmissions?

提交回复
热议问题