How to improve the performance of an Android app

Asked

Viewed 59 times

2

I am developing an Android application that receives data from a webservice (Json php).

The structure of the project: To get the data I’m using asynctask, I have a progressibar in preExecute and proExecute visualizes the data. The class of 'asynctask' is called in onCreate ().

Problems: The passage of the data from the webservice to android takes a long time and progress also and if the user turns the screen, restarts the search, and this makes the application boring.

How do I solve this problem ? What is the technique used in applications like Whatssap or Messanger?

1 answer

2


The method you choose to use to upload data from a web service to a background thread will not influence performance. Regarding the loss of work done, this is characteristic of Asynctask which is one of the simplest implementations of multitheading on Android and is generally used for faster processing (image decoding, for example) and that there are no problems if the job is rebooted. For longer processing and that do not depend on the state of the Activity, I suggest the use of Loaders or Services, preferably the latter for your case, as they are totally independent of the life cycle of the Activity.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.