Wednesday 7 November 2012

Android Manifest XML file





XML

  • Used to define some of the resources


  1. Layouts (UI)
  2. Strings
  3. Manifest file


  • Shouldn’t usually have to edit it directly,Eclipse can do that for you
  • Preferred way of creating UIs


  1. Separates the description of the layout from any actual code that controls it
  2. Can easily take a UI from one platform to another


R Class

  • Auto-generated: you shouldn’t edit it
  • Contains IDs of the project resources
  • Enforces good software engineering
  • Use findViewById and Resources object to get access to the resources


  1. Ex. Button b = (Button)findViewById(R.id.button1)
  2. Ex. getResources().getString(R.string.hello));

Layouts 

  • Eclipse has a great UI creator
  • Generates the XML for you
  • Composed of View objects
  • Can be specified for portrait and landscape mode


1 comments:

Anonymous said...

Effective tutorials...