Here comes the bad app – performance improvements
What are the do's and don'ts for Android application development to avoid performance issues, even if they may not occur on your own device? Testing Android apps is hard because there are so many devices out there. It is better to be safe than sorry, so write your code carefully.
Some say that there are two basic rules to writing efficient code: don't do the work that you don't need to do (hence the DRY and YAGNI principles from Chapter 8, Improving Quality) and do not allocate memory if you can avoid it. In addition to this, it is also interesting to know that there are various libraries available that will not just save you the time but also prove to be very efficient. Of course, reinventing the wheel could be error prone as well.
Think of the RetroFit
library, for example, that will make it much easier to write code to consume web services, or think of Picasso
, an image loading library that will load an image from a URL with just one line...