I’ve now read a few interesting things that you should consider when programming Android in order to ensure as much performance as possible:
- As rarely as possible allocate memory
- Possible use etc but no integer int.
- 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.
- Multidimensional arrays can be simulated by one dimensional. Rumgetrickse for me a bit too much at the expense of readability ..
- Virtual methods instead of interface methods (eg, not using hashmap Map)
- Static methods are much faster than virtual
- no getter and setter
- Instead of access to member variables, they should only pass to a local.
- Do not use enums but constants for the elements of enums
- 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.