February 14, 2011

Android Application Menu Types

Android supports 3 types of Application Menus. Those are
1. Options Menu
2. Context Menu
3. Sub Menu
Options Menu :
      It is a collection of Menu items which will appear when the user invokes "Menu" button on the Android device.
                                                           Example for Options Menu
If the item count is <= 6 then all those are displayed properly.
If the item count is >6 then more button will appear default. If we press on the more button then remaining items will appear as shown below.
  
Context Menu :
    Context Menu is the menu which is similar to right click on your desktop computer. It means it will raise when the user tap or click on a list item it will display a menu.
Sub Menu :
    It is also a list of menu item that will appear if the user selects item in the menu item contains a nested list of menu.
   For example item 3 is having a Sub Menu.
 
Sub Menu
If you want more detail about Menus go through the following link

February 09, 2011

Storing Persistent data in Android using Shared Preferences

In android we have more ways to store persistent data. Shared Preferences is one of the way to store primitive private data.

Shared Preferences store data in the form of key value pairs. Using shared preferences we can store string, booleans, float, int, long etc. Shared Preferences store data until app uninstallation. 

Example:
 //Reading values from the Preferences

SharedPreferences prefs = getSharedPreferences("Pref_Name", MODE_WORLD_READABLE);
int StoredDealNumber =  prefs.getInt("Key", 0);

In order modify data in preferences we have to use Editor.
//Modification of the Preferences
SharedPreferences prefs = getSharedPreferences("Pref_Name", MODE_WORLD_WRITEABLE);
SharedPreferences.Editor     Prefeditor = prefs.edit();
Prefeditor .putInt("no", 1); // value to store
Prefeditor .commit();

Note:
After modification we have to commit the values. Otherwise the values are not modified.

February 04, 2011

Android OS Features

Android is an operation system for the mobile devices. Android SDK (Software Development Kit) provides tools and API's to develop applications on the Android Platform.
Android Applications are developed using Java Programing language.
Features:
Good Development Environment
Application Frame Work
Dalvik Virtual Machine
Graphics
Gps (Globel Positioning System)
Media Support
GSM (Global System For Mobile)
Blue Tooth
Camera
Edge, Wi-Fi, 3G (Dependent On Hardware)
Integrated Browser
Note:
If you want more details about the content visit
http://developer.android.com/guide/basics/what-is-android.html