10 Rules Every Android Programmer Should Know

I’ve now read a few interesting things that you should consider when programming Android in order to ensure as much performance as possible:

  1. As rarely as possible allocate memory
  2. Possible use etc but no integer int.
  3. Temporary return values ​​to avoid if possible! Strings that are used once and then return to the no longer needed brakes, the system unnecessarily. Rather the operation on the string to move the method itself.
  4. Multidimensional arrays can be simulated by one dimensional. Rumgetrickse for me a bit too much at the expense of readability ..
  5. Virtual methods instead of interface methods (eg, not using hashmap Map)
  6. Static methods are much faster than virtual
  7. no getter and setter
  8. Instead of access to member variables, they should only pass to a local.
  9. Do not use enums but constants for the elements of enums
  10. Avoid use of floating point numbers as floating-point arithmetic must be simulates cumbersome.

    One has therefore to ensure the performance of a piece of code readability, reduce and rewrite in a few years, the unreadable code again.