View Single Post
  #20 (permalink)  
Old 03-28-2008, 05:10 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 324
amansundar is on a distinguished road
Default Re: Android Tips and tricks

Writing Efficient Android Code

There's no way around it: Android devices are embedded devices. Modern handsets may be more like small handheld computers than mere phones these days, but even the fastest, highest-end handset doesn't even come close to the capabilities of even a modest desktop system.

That's why it's very important to consider performance when you write Android applications. These systems are not that fast to begin with and they are also constrained by their battery life. This means that there's not a lot of horsepower to spare, so when you write Android code it's important to write it as efficiently as possible.

This page describes a number of things that developers can do to make their Android code run more efficiently. By following the tips on this page, you can help make sure your code runs as efficiently as possible.

Contents

* Introduction
* Avoid Creating Objects
* Use Native Methods
* Prefer Virtual Over Interface
* Prefer Static Over Virtual
* Avoid Internal Getters/Setters
* Cache Field Lookups
* Declare Constants Final
* Use Enhanced For Loop Syntax With Caution
* Avoid Enums
* Use Package Scope with Inner Classes
* Avoid Float
* Some Sample Performance Numbers
* Closing Notes
__________________
cheers
Aman
Reply With Quote