Effective Android Programming Techniques

Posted by kunjaan on Stack Overflow See other posts from Stack Overflow or by kunjaan
Published on 2010-06-02T19:42:01Z Indexed on 2010/06/07 1:22 UTC
Read the original article Hit count: 371

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.

© Stack Overflow or respective owner

Related posts about android

Related posts about Tips