Monday, 4 April 2011

Android Menus - hidden but vital

The menu is the part of the application which is hidden but it is vital to set the preferences and other options.

There are two types of menus:
  • Contextual Menu: You see it press on the screen and hold it for a while
  • Option Menu: You see it when you press on the "Menu" button.
There are two ways to "draw" the menu on the screen: Hard coding the java file or using an XML files.

Once the menu is created, the java code should handle the actions. No matter which method is used to draw the menus, the methods to capture and assign the behaviour of the menu are the same.

Personally I found the second method more clear. It separates the handler part of the display part.

Since I found good tutorial about it, I won't write too much.

DroidNova:,427.html (Easy and simple. XML way)
DeveloperLife: (Complete but complicated, Java way)

For more information:
Official Developer guide:
Official Developer design guidelines:

No comments:

Post a Comment