XML
- Used to define some of the resources
- Layouts (UI)
- Strings
- Manifest file
- Shouldn’t usually have to edit it directly,Eclipse can do that for you
- Preferred way of creating UIs
- Separates the description of the layout from any actual code that controls it
- 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
- Ex. Button b = (Button)findViewById(R.id.button1)
- 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:
Effective tutorials...
Post a Comment