Android ::: Effective Android Programming Techniques


Please Help me compile a list of Effective Android Programming techniques
  1. Don't forget to free resources after use.
    Lot of resources like Cursors are overlooked. Free them too.

  2. Don't Use magic Numbers.
    values[0] is meaningless. The framework provides very useful accessors like values[SensorManager.DATA_X]

  1. "Make use of onPause()/onResume to save or close what does not need to be opened the whole time."
    protected void onResume() {
    mSensorManager.registerListener(...);
    }
    protected void onStop() {
      mSensorManager.unregisterListener(...);
      super.onStop();
    }
    
  2. Make your Android UI Fast and Efficient from the Google I/O has a lot of useful UI Performance tips.

Popular Posts