Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap-Skipped 33 frames! The application may be doing too much work on its main thread

I'm new for the development of android-phonegap application. I want to display the students details from a database in the server. When i tried to connect with database, it shows me "Skipped 33 frames! The application may be doing too much work on its main thread" in eclipse IDE.

Please give me solution, or suggestion if any.

like image 353
user2750238 Avatar asked Dec 12 '25 09:12

user2750238


1 Answers

This is because Choreographer of android is not getting required resource for performing proper display hence skipping frames.

this mainly happens when user perform heavy operations in main thread, remember Android is single threaded system, there is Single main thread where all the other subsystem hooks upon to perform task such as Activities,Services,Content Providers. thats why when you perform network operation directly on main thered you get Application not responding message.

To elaborate upon your situation, do the following.

  1. If you have any network operation being done in main thread, move them to a separate thread, in Android native we have AsyncTask for that, try finding thread mechanism in Phonegap

  2. If you have any heavy operations such as Compression of Bitmap etc, handle them efficiently by threads or post runnable logic, this will make sure your main thread is free for trivial task such as generation of display processing of events etc.

In the sense, any logic which might take some time, move it to threads, this will make sure your display run smooth.

Hope it help.

like image 77
Techfist Avatar answered Dec 14 '25 05:12

Techfist