Tunya
Tunya

Reputation: 1

android application can run on emulator fine but very slow when run on android phone

My developed android application can run on emulator fine but when I export it to .apk and install to my galaxy S it very slow to show any content.

My application have to connect with web service and database that run on localhost. I try to move web service and database to another host that faster but it doesn't solve my problem. Any one can suggest me what should I do?

Thank you for any suggestion.

Ps. I develop my application by using Java with Eclipse and Tomcat

Upvotes: 0

Views: 1348

Answers (4)

pankajagarwal
pankajagarwal

Reputation: 13582

Database operations in Samsung Galaxy S are terribly slow (especially after 2.2 update). If the app performance is fine on the emulator then it should work fine on other devices too

Upvotes: 1

vidstige
vidstige

Reputation: 13085

To find the bottleneck of the program, use Traceview on the device. It can be started very easily in the Eclipse IDE.

Most likely you are running the Emulator sharing the high-speed connection of your PC running the emulator. The device will have lower bandwith and also a large delay.

Most time is usally spent receiving data. Compressing transfers thus actually speeds up the app. Compressing the answer is straight-forward both on the server and the client, see for example this answer.

If this is not enough you need to look through what is sent from the server and see if some things can be pre-fetched or omitted.

Upvotes: 1

Peter Knego
Peter Knego

Reputation: 80340

Use traceview to inspect which parts of your code are slow. Than optimize those parts.

If you use slow external services (network calls) you might want to use AsyncTask to run them in the background. Also, it's good practice to show some kind of progress notification to the user so that they know something is being worked on.

Upvotes: 1

Anthony Graglia
Anthony Graglia

Reputation: 5435

You will have to elaborate on this a lot! Sounds like you are using an outside DB. how are you interacting with it? Async? how is the data being passed around?

Need more info.

Upvotes: 0

Related Questions