0

I am working on an application where whole data came from the API. I mostly used fragment in my application at some fragment my application did not take too much time. But at some Fragment It take to much time to display the Layout. When I debug the application I saw that data has came rapidly but it take time to display the data . And in the Log I got a message "this Application doing lot of task in its main thread". Is there any way to improve the performance of the application ?

Abhishek Bhardwaj
  • 1,164
  • 3
  • 14
  • 39

3 Answers3

0

you can use volley libraries to download data fast and for image use picaso and for database use relm database its fast api dont use old style httpcliant or json parser its slow.and first display data from database then store data of api in database and again dispaly from database in onpause method after some time(dippents on our data how much time tack to load ).if you have large data in json use pagination tachniq.

android_jain
  • 788
  • 8
  • 19
0

In my case, I am facing the same issues when I try to parse the JSON Results as a markers in GoogleMap.For <1000 Json Objects it works fine But when the Json Result Object Exceeds >1000 my app gets hangs and it takes too much of time to load. Here What I have done to fix the issue

i am assuming you are deal with JSon Data.

  1. Reduce the Size of JSon Results Based on Some Conditions.

  2. Use small tags for JSon Lables(for Ex. instead of lable latitude use l,instead of longitude use lo)

  3. Avoid HttpClient for Network Calls,Use Appropriate Network Library(like volly,Retrofit,OkHttp) based on Your Requirement NetworkLibraries Difference

  4. If you have any Calculations with the Result data Try to done it from the Server side as much as Possible

  5. Remove Unwanted data in the JSON Result.
Community
  • 1
  • 1
RAJESH KUMAR ARUMUGAM
  • 1,560
  • 21
  • 35
0

Please follow this guide line for Android app development Click here

Milan Pansuriya
  • 2,521
  • 1
  • 19
  • 33