Chapter 10

Optimizing Your Code

Second to device fragmentation, the most severe problem you'll encounter when writing Java ME applications is lack of CPU power. The typical Java ME device offers very limited CPU power, usually enough to comfortably run simple applications but not enough to run more complex applications, with lots of background tasks and fancy user interfaces. While this cannot be avoided, its impact on your application can be minimized by optimizing your code and your algorithms.

There is some good news and some bad news regarding this. The good news is that you can effortlessly get speed-ups of 10–20% by optimizing your code, and in some cases the speed-up can be 200% or even more, with the typical speed-up somewhere between ...

Get Pro Java ME Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.